#include <bits/stdc++.h>
using namespace std;
string stringify(int hrs, int min) {
  string ans = "";
  if (hrs / 10 == 0) {
    ans = "0";
  }
  ans += to_string(hrs) + ":";
  if (min / 10 == 0) {
    ans += "0";
  }
  ans += to_string(min);
  return ans;
}
int main() {
  string s;
  cin >> s;
  int hrs = stoi(s.substr(0, 2));
  int mins = stoi(s.substr(3, 2));
  int temp = hrs / 10 + 10 * (hrs % 10);
  if (temp > mins && temp < 60) {
    cout << stringify(hrs, temp);
  } else {
    int min = 60;
    while (min >= 60) {
      hrs = (hrs + 1) % 24;
      min = hrs / 10 + 10 * (hrs % 10);
    }
    cout << stringify(hrs, min);
  }
  return 0;
}
