#include <bits/stdc++.h>
using namespace std;
long long fp(long long n, long long p) {
  if (p == 0) return 1;
  if (p == 1) return n;
  long long res;
  res = fp(n, p / 2);
  res = (res * res);
  if (p % 2) res = (res * n);
  return res;
}
bool val(int a, int b) {
  string s, ss;
  stringstream w;
  w << a;
  w >> s;
  if (int(s.size()) == 1) s = "0" + s;
  stringstream ww;
  ww << b;
  ww >> ss;
  if (int(ss.size()) == 1) ss = "0" + ss;
  s += ss;
  int i = 0, n = int(s.size());
  while (i <= n - i + 1) {
    if (s[i] != s[n - i - 1]) return 0;
    i++;
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  ;
  int n, m;
  char c;
  cin >> n >> c >> m;
  while (1) {
    m++;
    if (m == 60) {
      m = 0;
      n++;
      if (n == 24) n = 0;
    }
    if (val(n, m)) {
      if (n < 10)
        cout << 0 << n;
      else
        cout << n;
      cout << ":";
      if (m < 10)
        cout << 0 << m;
      else
        cout << m;
      return 0;
    }
  }
  return 0;
}
