#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long MAX = 1e2 + 5;
const long long MAX2 = 11;
const int MOD = 1000000000 + 7;
const long long INF = 20000;
const int nr[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int nc[] = {0, 1, 0, -1, 1, -1, 1, -1};
int sz, mx;
string s, ans;
map<string, int> m;
int main() {
  cout << fixed << setprecision(0);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  sz = s.size() - 1;
  for (long long i = 9; i <= sz; i++) {
    if (s[i - 9] != '-' && s[i - 8] != '-' && s[i - 7] == '-' &&
        s[i - 6] != '-' && s[i - 5] != '-' && s[i - 4] == '-' &&
        s[i - 3] != '-' && s[i - 2] != '-' && s[i - 1] != '-' && s[i] != '-') {
      ans = s[i - 9];
      ans += s[i - 8];
      ans += s[i - 7];
      ans += s[i - 6];
      ans += s[i - 5];
      ans += s[i - 4];
      ans += s[i - 3];
      ans += s[i - 2];
      ans += s[i - 1];
      ans += s[i];
      m[ans]++;
    }
  }
  for (auto i : m)
    if (mx < i.second) mx = i.second, ans = i.first;
  cout << ans << "\n";
  return 0;
}
