#include <bits/stdc++.h>
int check(int a, int b) {
  if ((a / 10 == b % 10) && (a % 10 == b / 10))
    return 1;
  else
    return 0;
}
int main() {
  int a, b;
  while (scanf("%d:%d", &a, &b) != EOF) {
    while (1) {
      b++;
      if (b == 60) {
        b = 0, a++;
        if (a == 24) {
          a = 0;
        }
      }
      if (check(a, b)) break;
    }
    printf("%02d:%02d\n", a, b);
  }
  return 0;
}
