#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  scanf("%d:%d", &h, &m);
  m++;
  int dv = h % 10, c = h / 10 % 10, p = dv * 10 + c, dem = 0;
  if (p < m || p >= 60) {
    int g = h + 1;
    if (g == 24) g = 0;
    do {
      dv = g % 10;
      c = g / 10 % 100;
      p = dv * 10 + c;
      if (p >= 60) g++;
    } while (p >= 60);
    printf("%02d:%02d", g, p);
  } else
    printf("%02d:%02d", h, p);
  return 0;
}
