#include <bits/stdc++.h>
using namespace std;
int main() {
  string in;
  cin >> in;
  int mins = (in[3] - '0') * 10 + (in[4] - '0'),
      hours = (in[1] - '0') * 10 + (in[0] - '0');
  if (in[1] == '6' || in[1] == '7' || in[1] == '8' || in[1] == '9' ||
      (in[0] == in[4] && in[1] == in[3] && in[1] == '5') ||
      (in[1] == '5' && mins > hours)) {
    if (in[0] == '0')
      in = "10:01";
    else if (in[0] == '1')
      in = "20:02";
  } else {
    if (hours <= mins && in[0] == '2' && in[1] == '3') {
      in = "00:00";
    } else if (hours <= mins) {
      in[1]++;
      in[3] = in[1];
      in[4] = in[0];
    } else {
      in[3] = in[1];
      in[4] = in[0];
    }
  }
  cout << in;
  return 0;
}
