#include <bits/stdc++.h>
using namespace std;
int main() {
  string time;
  cin >> time;
  int x = 0;
  bool flag = false;
  bool flag2 = false;
  bool flag3 = false;
  int i1 = time[0] - '0';
  int i2 = time[1] - '0';
  int i3 = time[3] - '0';
  if (i1 == 0) flag3 = true;
  int i4 = time[4] - '0';
  int ii = i1 * 10 + i2;
  int ii2 = i3 * 10 + i4;
  int u = ii2 + 1;
  int y = ii;
  int r, t;
  for (y = ii; y < 24; y++) {
    for (u; u < 60; u++) {
      r = u % 10;
      t = u / 10 % 10;
      if (y == ((r * 10) + t)) {
        flag = true;
        break;
      }
    }
    u = 0;
    if (y == ((r * 10) + t)) {
      break;
    }
  }
  if (flag) {
    if (y < 10) flag2 = true;
    if (t * 10 + r < 10) flag3 = true;
    if (flag2) {
      cout << "0" << y << ":" << (t * 10) + r;
    } else if (flag3) {
      cout << y << ":"
           << "0" << (t * 10) + r;
    } else
      cout << y << ":" << (t * 10) + r;
  } else
    cout << "00:00";
  return 0;
}
