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