#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int f(int h) {
  int g1 = h % 10;
  int g2 = h / 10;
  int p = g1 * 10 + g2;
  if (p < 60)
    return p;
  else
    return 0;
}
int main() {
  int hh1, mm1;
  char g;
  cin >> hh1 >> g >> mm1;
  int mm2 = f(hh1);
  if (mm2 != 0 && mm2 > mm1)
    ;
  else {
    hh1 = hh1 + 1;
    if (hh1 == 24) {
      hh1 = 0;
      mm2 = 0;
    } else {
      mm2 = f(hh1);
      while (mm2 == 0) {
        mm2 = f(++hh1);
      }
    }
  }
  if (hh1 > 9)
    cout << hh1;
  else
    cout << "0" << hh1;
  if (mm2 > 9)
    cout << ":" << mm2;
  else
    cout << ":0" << mm2;
}
