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