#include <bits/stdc++.h>
int main(void) {
  int n, i, hh, mm, x, mm1, hh1;
  char a[6];
  scanf("%s", a);
  for (i = 0; i < 5; i++) a[i] = a[i] - 48;
  hh = (a[0] * 10) + a[1];
  mm = (a[3] * 10) + a[4];
  if (hh % 10 <= 5) {
    mm1 = a[1] * 10 + a[0];
    if (mm1 > mm)
      printf("%.2d:%.2d", hh, mm1);
    else {
      hh++;
      if (hh == 24)
        printf("00:00");
      else if (hh % 10 == 6) {
        hh += 4;
        mm1 = 0;
        hh1 = hh;
        while (hh) {
          x = hh % 10;
          mm1 = mm1 * 10 + x;
          hh /= 10;
        }
        if (hh1 <= 9) mm1 *= 10;
        printf("%.2d:%.2d", hh1, mm1);
      } else {
        mm1 = 0;
        hh1 = hh;
        while (hh) {
          x = hh % 10;
          mm1 = mm1 * 10 + x;
          hh /= 10;
        }
        if (hh1 <= 9) mm1 *= 10;
        printf("%.2d:%.2d", hh1, mm1);
      }
    }
  } else {
    while (hh >= 0) {
      x = hh % 10;
      if (x == 0 || x == 1) {
        x++;
        hh1 = x % 10;
        hh1 *= 10;
        break;
      }
      hh /= 10;
    }
    mm1 = x;
    printf("%.2d:%.2d", hh1, mm1);
  }
  return 0;
}
