#include <bits/stdc++.h>
bool palindrome(char *s) {
  int r = 4;
  for (int i = 0; i < 5; i++) {
    if (s[i] != s[r--]) return false;
  }
  return true;
}
int main() {
  int mnt, h;
  char s[10];
  scanf("%s", &s);
  do {
    mnt = (s[3] - '0') * 10 + (s[4] - '0');
    h = (s[0] - '0') * 10 + (s[1] - '0');
    mnt++;
    if (mnt == 60) {
      h++;
      mnt = 0;
      if (h == 24) h = 0;
    }
    sprintf(s, "%.2d:%.2d", h, mnt);
  } while (!palindrome(s));
  printf("%s\n", s);
  return 0;
}
