#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  stringstream ss;
  s[2] = ' ';
  ss << s;
  int hh, mm;
  ss >> hh >> mm;
  for (int h = hh;; ++h) {
    if (h >= 24) h = 0;
    for (int m = (h == hh ? mm + 1 : 0); m < 60; ++m) {
      char buffer[5];
      sprintf(buffer, "%.2d:%.2d", h, m);
      string a1(buffer, buffer + 5), a2;
      a2 = a1;
      reverse((a1).begin(), (a1).end());
      if (a1 == a2) {
        cout << a1 << endl;
        return 0;
      }
    }
  }
  return 0;
}
