#include <bits/stdc++.h>
char aa[1000000];
char bb[1000000][10];
int i, j, a, b = 0, n, jl[1000000];
int jl22[1000000];
int main() {
  scanf("%s", aa);
  n = strlen(aa);
  for (i = 0; i < n - 9; i++) {
    a = 0;
    for (j = i; j < i + 10; j++) bb[b][a++] = aa[j];
    bb[b][a] = '\0';
    if (bb[b][2] == '-' && bb[b][5] == '-' && bb[b][0] != '-' &&
        bb[b][1] != '-' && bb[b][3] != '-' && bb[b][4] != '-' &&
        bb[b][6] != '-' && bb[b][8] != '-' && bb[b][7] != '-' &&
        bb[b][9] != '-') {
      b++;
    }
  }
  memset(jl, 0, sizeof(jl));
  memset(jl22, 0, sizeof(jl22));
  for (i = 0; i < b - 1; i++) {
    for (j = i + 1; j < b; j++) {
      for (int k = 0; k < 10; k++) {
        if (bb[i][k] != bb[j][k] || jl22[i] == 1) {
          break;
        }
        jl22[k] = 1;
        jl[i] += 1;
      }
    }
  }
  if (b == 1) {
    for (i = 0; i < 10; i++) printf("%c", bb[1][i]);
    return 0;
  }
  int maxn = 0;
  int jl2;
  for (j = 0; j < b; j++) {
    if (maxn < jl[j]) {
      maxn = jl[j];
      jl2 = j;
    }
  }
  for (i = 0; i < 10; i++) printf("%c", bb[jl2][i]);
  puts("");
  return 0;
}
