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