#include <bits/stdc++.h>
char s[5];
int check(int t) {
  int h = t / 60;
  int m = t % 60;
  if (h / 10 == m % 10 && h % 10 == m / 10) return 1;
  return 0;
}
void form(int t) {
  int h = t / 60;
  int m = t % 60;
  s[0] = h / 10 + '0';
  s[1] = h % 10 + '0';
  s[2] = ':';
  s[3] = m / 10 + '0';
  s[4] = m % 10 + '0';
}
int main() {
  gets(s);
  int found = 0;
  int t =
      (s[4] - '0') + (s[3] - '0') * 10 + (s[1] - '0') * 60 + (s[0] - '0') * 600;
  while (!found) {
    t = (t + 1) % 1440;
    if (check(t)) found = 1;
    if (found) {
      form(t);
      printf("%s", s);
    }
  }
  return 0;
}
