#include <iostream>
#include <set>
using namespace std;
int main() {
set<string> words;
string a;
while (cin >> a) {
if (words.count(a)) {
cout << a << endl;
break;
} else {
words.insert(a);
}
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c2V0PgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJc2V0PHN0cmluZz4gd29yZHM7CglzdHJpbmcgYTsKCQoJd2hpbGUgKGNpbiA+PiBhKSB7CgkJaWYgKHdvcmRzLmNvdW50KGEpKSB7CgkJCWNvdXQgPDwgYSA8PCBlbmRsOwoJCQlicmVhazsKCQl9IGVsc2UgewoJCQl3b3Jkcy5pbnNlcnQoYSk7CgkJfQoJfQp9