/* hash的一个题 偷懒用的map做
就是找由2个字典单词组成的 单词
*/
#include<cstdio>
#include<string>#include<cstring>
#include<map>
#include<algorithm>
#include<iostream>
using namespace std;
map<string,int> vis;
char s[120100][110];
int solve(int n)
{
for(int i = 0; i < n; i++)
{
int l = strlen(s[i]);
for(int j = 0; ; j++)
{
if(j>=l-1) break;
int k;
char t1[110],t2[110];
for(k = 0; k <= j; k++)
t1[k] = s[i][k];
t1[k] = '\0';
for(k = j+1; k < l; k++)
t2[k-j-1] = s[i][k];
t2[k-j-1] = '\0';
if(vis[t1]&&vis[t2])
{
cout<<s[i]<<endl;
break;
}
}
}
}
int main()
{
vis.clear();
int n = 0;
while((cin>>s[n]))
{
vis[s[n]] = 1;
n++;
}
solve(n);
return 0;
}