#include <bits/stdc++.h>
using namespace std;
int main() {
  string hours[16] = {"00:00", "01:10", "02:20", "03:30", "04:40", "05:50",
                      "10:01", "11:11", "12:21", "13:31", "14:41", "15:51",
                      "20:02", "21:12", "22:22", "23:32"};
  string s;
  cin >> s;
  int HH = stoi(s.substr(0, 2));
  int MM = stoi(s.substr(3, 2));
  for (int i = 0; i < 16; i++) {
    int myhour = stoi(hours[i].substr(0, 2));
    int mymin = stoi(hours[i].substr(3, 2));
    if (HH == myhour) {
      if (MM >= mymin) {
        if (HH == 23) {
          cout << hours[0];
          break;
        } else {
          cout << hours[i + 1];
          break;
        }
      } else {
        cout << hours[i];
        break;
      }
    } else if (myhour > HH) {
      cout << hours[i];
      break;
    }
  }
  return 0;
}
