#include <iostream>
#include <stdlib.h>
#include <vector>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::string;
int main()
{
string buf,mark;
cin >> mark;
int count = 0;
while (cin >> buf)//&&!buf.empty())
{
if (mark == buf)
{
count++;
cout << buf << endl;
break;
}
mark = buf;
}
if (count==0)
cout << "There is no same words!" << endl;
system("pause");
}