#include <bits/stdc++.h>
int getNumber(char *h, int i) {
  if (i == 0)
    return (h[0] - '0') * 10 + (h[1] - '0');
  else
    return (h[0] - '0') + (h[1] - '0') * 10;
}
int main() {
  int hora, min;
  char s[6];
  scanf(" %s", s);
  hora = getNumber(s, 0);
  min = getNumber(&s[3], 0);
  if (min >= getNumber(s, 1)) {
    hora++;
    if (hora == 24) {
      hora = 0;
      s[0] = '0';
      s[1] = '0' - 1;
    }
    if (hora > 15 && hora <= 19) {
      hora = 20;
      s[0] = '2';
      s[1] = '0' - 1;
    }
    if (hora > 5 && hora <= 9) {
      hora = 10;
      s[0] = '1';
      s[1] = '0' - 1;
    }
    printf("%.2d:%c%c\n", hora, s[1] + 1, s[0]);
  } else {
    if (hora > 15 && hora <= 19) {
      hora = 20;
      s[0] = '2';
      s[1] = '0';
    }
    if (hora > 5 && hora <= 9) {
      hora = 10;
      s[0] = '1';
      s[1] = '0';
    }
    printf("%.2d:%c%c\n", hora, s[1], s[0]);
  }
  return 0;
}
