#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, M;
  scanf("%d:%d", &H, &M);
  do {
    H = (H + (++M / 60)) % 24;
    M %= 60;
  } while (!(H / 10 == M % 10 && H % 10 == M / 10));
  printf("%02d:%02d\n", H, M);
}
