#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  char c;
  cin >> h >> c >> m;
  bool find = false;
  bool first = true;
  for (int i = h; i < 24 && !find; i++) {
    if (!first) m = -1;
    for (int j = m + 1; j < 60; j++) {
      if (i % 10 == j / 10 && i / 10 == j % 10) {
        h = i;
        m = j;
        find = true;
        break;
      }
    }
    first = false;
  }
  if (!find)
    cout << "00:00";
  else {
    if (h < 10) cout << 0;
    cout << h << ":";
    if (m < 10) cout << 0;
    cout << m;
  }
  return 0;
}
