#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tostr(const T& t) {
  ostringstream os;
  os << t;
  return os.str();
}
long long big = 10000000;
inline vector<string> split(string s, char delim) {
  int ndx = 0;
  vector<string> ret;
  string t = "";
  while (1) {
    if (ndx == (int)s.size()) {
      if (t != "") ret.push_back(t);
      break;
    }
    if (s[ndx] == delim) {
      if (t != "") {
        ret.push_back(t);
        t = "";
      }
      ++ndx;
      continue;
    }
    t += s[ndx];
    ++ndx;
  }
  return ret;
}
string makestr(int h, int m) {
  string x = tostr(h);
  if ((int)x.size() == 1) x = "0" + x;
  string y = tostr(m);
  if ((int)y.size() == 1) y = "0" + y;
  string z = x + ":" + y;
  return z;
}
bool ispal(int h, int m) {
  string z = makestr(h, m);
  string z2 = z;
  reverse((z2).begin(), (z2).end());
  return z == z2;
}
void inc(int& h, int& m) {
  if (m != 59)
    ++m;
  else {
    if (h == 23) {
      h = 0;
      m = 0;
    } else {
      ++h;
      m = 0;
    }
  }
}
int main() {
  string x;
  cin >> x;
  vector<string> tmp = split(x, ':');
  int h = atoi(tmp[0].c_str());
  int m = atoi(tmp[1].c_str());
  inc(h, m);
  while (!ispal(h, m)) {
    inc(h, m);
  }
  string ans = makestr(h, m);
  cout << ans << endl;
  return 0;
}
