#include <bits/stdc++.h>
using namespace std;
int main() {
  long long h;
  char c;
  long long m;
  cin >> h >> c >> m;
  while (1) {
    m = m + 1;
    if (m % 60 == 0) {
      m = 0;
      h = h + 1;
    }
    h = h % 24;
    if (h / 10 == m % 10 && h % 10 == m / 10) break;
  }
  cout << h / 10 << h % 10 << c << m / 10 << m % 10 << endl;
}
