#include <bits/stdc++.h>
using namespace std;
int main() {
  int hours, mins;
  scanf("%d:%d", &hours, &mins);
  bool notFound = true;
  while (notFound) {
    mins++;
    if (mins == 60) {
      mins = 0;
      hours++;
    }
    if (hours == 24) {
      hours = 0;
    }
    if (hours % 10 == mins / 10 && hours / 10 == mins % 10) {
      printf("%02d:%02d", hours, mins);
      notFound = false;
    }
  }
  return 0;
}
