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