#include <bits/stdc++.h>
using namespace std;
bool isPal(string s) {
  for (long long i = 0, j = s.length() - 1; i < j; i++, j--)
    if (s[i] != s[j]) return 0;
  return 1;
}
string lts111(long long n) {
  string a = "00:00";
  long long hr = n / 60;
  long long min = n % 60;
  long long fh = hr % 10;
  hr = hr / 10;
  a[0] = hr + 48;
  a[1] = fh + 48;
  fh = min % 10;
  min = min / 10;
  a[3] = min + 48;
  a[4] = fh + 48;
  return a;
}
long long stl111(string s) {
  long long hr = (s[0] - 48) * 10 + (s[1] - 48);
  long long min = (s[3] - 48) * 10 + (s[4] - 48);
  return hr * 60 + min;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long m = stl111(s);
  m = m + 1;
  while (1) {
    m = m % 1440;
    s = lts111(m);
    if (isPal(s)) {
      cout << s << endl;
      return 0;
    }
    m = m + 1;
  }
}
