#include <bits/stdc++.h>
using namespace std;
int check(int x) {
  if (x < 10) return x * 10;
  int sum = 0;
  while (x) {
    sum = sum * 10 + x % 10;
    x /= 10;
  }
  return sum;
}
int h, m;
int main() {
  scanf("%d:%d", &h, &m);
  while (true) {
    m++;
    if (m == 60) m = 0, h++;
    if (h == 24) h = 0;
    int res = check(h);
    if (res == m) break;
  }
  if (h < 10) cout << 0;
  cout << h << ":";
  if (m < 10) cout << 0;
  cout << m;
  return 0;
}
