#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 1 << 28;
const long long INFL = 1LL << 62;
int HH;
int MM;
void Hplus(void) { HH = HH == 23 ? 0 : HH + 1; }
void Mplus(void) {
  if (MM == 59) {
    MM = 0;
    Hplus();
  } else
    MM++;
}
bool NotPalindromic(void) {
  if (MM / 10 == HH % 10 && MM % 10 == HH / 10) return false;
  return true;
}
string ToStr() {
  string ans = "";
  ans += ((HH / 10) + '0');
  ans += ((HH % 10) + '0');
  ans += ':';
  ans += ((MM / 10) + '0');
  ans += ((MM % 10) + '0');
  return ans;
}
string str[] = {"YES", "NO"};
int main() {
  string x;
  cin >> x;
  HH = (x[1] - '0');
  HH += ((x[0] - '0') * 10);
  MM = (x[4] - '0');
  MM += ((x[3] - '0') * 10);
  Mplus();
  while (NotPalindromic()) Mplus();
  cout << ToStr() << endl;
}
