#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[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"},
         f;
  cin >> f;
  for (int i = 0; i < 16; i++) {
    if (s[i] > f) {
      cout << s[i];
      break;
    } else {
      if (f > s[15]) {
        cout << s[0];
        break;
      }
    }
  }
}
