#include <bits/stdc++.h>
using namespace std;
int palindrome(int b) {
  int rev = 0;
  for (int i = b; i > 0; i /= 10) rev = rev * 10 + i % 10;
  return rev;
}
int main() {
  int a, b, c, i, j, d = 0, e, f;
  scanf("%d", &a);
  getchar();
  scanf("%d", &b);
  a *= 100;
  a += b;
  while (1) {
    if (a > 2359)
      break;
    else {
      b = a % 100;
      if (b == 59) {
        a += 41;
      } else
        ++a;
    }
    c = palindrome(a);
    e = a % 100;
    f = a / 100;
    if (f < 10 && e < f * 10) continue;
    if (f == 0) continue;
    if (f < 10) {
      if (e % 10 == 0) e = e / 10;
      if (e == f) {
        d = 1;
        break;
      }
      continue;
    }
    if (c == a) {
      d = 1;
      break;
    }
  }
  b = a % 100;
  a = a / 100;
  if (d == 1) {
    if (a < 10)
      cout << "0" << a << ":";
    else
      cout << a << ":";
    if (b < 10)
      cout << "0" << b;
    else
      cout << b;
  } else
    printf("00:00\n");
}
