#include <bits/stdc++.h>
using namespace std;
char str[10];
bool check(int x, int y) {
  sprintf(str, "%02d:%02d", x, y);
  return (str[0] == str[4] && str[1] == str[3]);
}
int main() {
  int i, j, n, m;
  scanf("%d:%d", &n, &m);
  for (i = n; i < 24; ++i) {
    for (j = 0; j < 60; ++j) {
      if (i == n && j <= m) continue;
      if (check(i, j)) {
        printf("%s", str);
        return 0;
      }
    }
  }
  cout << "00:00" << endl;
  return 0;
}
