#include <bits/stdc++.h>
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
using namespace std;
int main() {
  int h, m;
  char c;
  string ph, pm;
  cin >> h >> c >> m;
  if (h == 23 && m >= 32) {
    cout << "00:00";
    exit(0);
  }
  int i, j;
  if (m == 59)
    j = 0;
  else
    j = m + 1;
  for (i = h; i <= 23; i++) {
    for (; j <= 59; j++) {
      if (i < 10)
        ph = "0" + to_string(i);
      else
        ph = to_string(i);
      if (j < 10)
        pm = "0" + to_string(j);
      else
        pm = to_string(j);
      reverse(pm.begin(), pm.end());
      if (ph == pm) {
        if (i < 10) {
          cout << "0" << i << ":" << j << endl;
          exit(0);
        } else if (j < 10) {
          cout << i << ":"
               << "0" << j << endl;
          exit(0);
        } else {
          cout << i << ":" << j << endl;
          exit(0);
        }
      }
    }
    j = 0;
  }
}
