#include <bits/stdc++.h>
using namespace std;
bool checkPalindrome(int hour, int minute) {
  string H = to_string(hour), M = to_string(minute);
  if (hour < 10) H = "0" + H;
  if (minute < 10) M = "0" + M;
  reverse(M.begin(), M.end());
  if (H == M) {
    reverse(M.begin(), M.end());
    cout << H << ":" << M << "\n";
    return true;
  }
  return false;
}
int main() {
  string str;
  cin >> str;
  int hour = stoi(str.substr(0, 2)), minute = stoi(str.substr(3, 2));
  while (true) {
    minute++;
    if (minute == 60) minute = 0, hour++;
    if (hour == 24) hour = 0;
    if (checkPalindrome(hour, minute)) break;
  }
  return 0;
}
