#include <bits/stdc++.h>
using namespace std;
int hour, minute;
void inc() {
  minute++;
  if (minute == 60) {
    minute = 0;
    hour++;
  }
  hour %= 24;
}
int tens(int x) { return (x / 10) % 10; }
int ones(int x) { return x % 10; }
int main() {
  cin >> hour;
  cin.ignore(1, ':');
  cin >> minute;
  while (true) {
    inc();
    if (tens(hour) == ones(minute) && ones(hour) == tens(minute)) {
      cout << setw(2) << setfill('0') << hour;
      cout << ':';
      cout << setw(2) << setfill('0') << minute;
      cout << '\n';
      break;
    }
  }
}
