#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  char t;
  cin >> h >> t >> m;
  for (int i = 1; i <= 24 * 60; ++i) {
    int tt = i + h * 60 + m;
    int th = (tt / 60) % 24;
    int tm = tt % 60;
    auto ch = to_string((unsigned long long)th);
    if (ch.size() == 1) ch = "0" + ch;
    auto cm = to_string((unsigned long long)tm);
    if (cm.size() == 1) cm = "0" + cm;
    reverse(cm.begin(), cm.end());
    if (cm == ch) {
      reverse(cm.begin(), cm.end());
      cout << ch << ":" << cm << endl;
      break;
    }
  }
  return 0;
}
