#include <bits/stdc++.h>
int h, m;
int main() {
  while (scanf("%d:%d", &h, &m) == 2) {
    while (1) {
      m = ++m % 60;
      if (m == 0) h = ++h % 24;
      if (h / 10 == m % 10 && h % 10 == m / 10) break;
    }
    printf("%02d:%02d\n", h, m);
  }
  return 0;
}
