#include <bits/stdc++.h>
time_t waktu = clock();
void gettime() {
  printf("\nTime : %.2lf", (clock() - waktu) / double(CLOCKS_PER_SEC));
}
using namespace std;
int main() {
  int data1, data2, data1x, data2x;
  char data[10];
  scanf("%s", &data);
  data1 = (data[0] - 48) * 10 + (data[1] - 48);
  data1x = (data[1] - 48) * 10 + (data[0] - 48);
  data2 = (data[3] - 48) * 10 + (data[4] - 48);
  data2x = (data[4] - 48) * 10 + (data[3] - 48);
  if (data1x <= data2 || (data1x > data2 && data1x >= 60)) {
    data1++;
    data1x = (data1 % 10) * 10 + data1 / 10;
    while (data1x >= 60) {
      data1++;
      data1x = (data1 % 10) * 10 + data1 / 10;
    }
    if (data1 == 24)
      printf("00:00");
    else
      printf("%d%d:%d%d", data1 / 10, data1 % 10, data1 % 10, data1 / 10);
  } else
    printf("%d%d:%d%d", data1 / 10, data1 % 10, data1 % 10, data1 / 10);
  return 0;
}
