#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int32_t main() {
  ios_base::sync_with_stdio(false);
  int h, m;
  char t;
  cin >> h >> t >> m;
  int x = h % 10 * 10 + h / 10;
  if (m >= x) ++h;
  while (h % 10 >= 6) {
    ++h;
  }
  h %= 24;
  if (h < 10) cout << 0;
  cout << h << t << h % 10 << h / 10;
}
