#include <bits/stdc++.h>
using namespace std;
string con(int x) {
  string s = "";
  if (x == 0) {
    s = "00";
    return s;
  }
  if (x < 10) {
    s += '0';
    s += (x + '0');
    return s;
  }
  while (x != 0) {
    int p = x % 10;
    s += (p + '0');
    x /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
bool check(string s) {
  string s1 = s;
  reverse(s1.begin(), s1.end());
  if (s == s1) {
    return true;
  } else {
    return false;
  }
}
int main() {
  int hh, mm;
  string s = "12";
  scanf("%d:%d", &hh, &mm);
  while (!check(s)) {
    mm += 1;
    if (mm == 60) {
      mm = 0;
      hh += 1;
      if (hh == 24) {
        hh = 0;
      }
    }
    s = con(hh);
    s += con(mm);
  }
  cout << s[0] << s[1] << ':' << s[2] << s[3] << endl;
  return 0;
}
