#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, h, m;
string s, c, t;
bool Check() {
  if (m == 60) m = 0, ++h;
  if (h == 24) h = 0;
  c = "";
  t = "";
  char f;
  f = h / 10 + 48;
  c = f;
  f = h % 10 + 48;
  c += f;
  f = m / 10 + 48;
  t = f;
  f = m % 10 + 48;
  t += f;
  if (c[0] == t[1] && t[0] == c[1]) return 0;
  return 1;
}
int main() {
  cin >> s;
  h = (s[0] - '0') * 10 + s[1] - '0';
  m = (s[3] - '0') * 10 + s[4] - '0';
  ++m;
  while (Check()) ++m;
  cout << c << ":" << t;
  return 0;
}
