#include <bits/stdc++.h>
using namespace std;
bool ck(string s1, string s2) {
  reverse(s1.begin(), s1.end());
  if (s1 == s2)
    return true;
  else
    return false;
}
string int2str(int n) {
  ostringstream str;
  str << n;
  string s;
  s = str.str();
  if (s.size() == 1) {
    s += "0";
    reverse(s.begin(), s.end());
  }
  return s;
}
int main() {
  int a, b;
  char ch;
  cin >> a >> ch >> b;
  string s1, s2;
  while (1) {
    b = b + 1;
    if (b == 60) {
      b = 0;
      a = a + 1;
      if (a == 24) a = 0;
    }
    s1 = int2str(a);
    s2 = int2str(b);
    if (ck(s1, s2)) {
      cout << s1 << ":" << s2 << endl;
      break;
    }
  }
  return 0;
}
