#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  scanf("%d:%d", &h, &m);
  auto check = [=](int a, int b) -> bool {
    string x = to_string(a);
    string y = to_string(b);
    x = string(2 - x.size(), '0') + x;
    y = string(2 - y.size(), '0') + y;
    reverse(begin(y), end(y));
    return x == y;
  };
  bool flag = true;
  while (!check(h, m) || flag) {
    ++m;
    if (m == 60) {
      m = 0;
      h = (++h == 24 ? 0 : h);
    }
    flag = false;
  }
  printf("%02d:%02d", h, m);
  return 0;
}
