#include <bits/stdc++.h>
using namespace std;
string ITS(int X) {
  string str = "AS";
  str[0] = X / 10 + '0';
  str[1] = X % 10 + '0';
  return str;
}
int main() {
  int H, M;
  scanf("%d:%d", &H, &M);
  while (1) {
    M++;
    if (M > 59) M = 0, H++;
    if (H > 23) H = 0;
    if (ITS(H)[0] == ITS(M)[1] && ITS(H)[1] == ITS(M)[0]) {
      printf("%02d:%02d", H, M);
      return 0;
    }
  }
}
