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