#include <bits/stdc++.h>
using namespace std;
int main() {
  char useless;
  int h, min;
  scanf("%d%c%d", &h, &useless, &min);
  do {
    if (min == 59 && h == 23) {
      h = 0;
      min = 0;
    } else if (min == 59) {
      h++;
      min = 0;
    } else
      min++;
  } while (h != 10 * (min % 10) + min / 10);
  printf("%02d%c%02d", h, useless, min);
  return 0;
}
