#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  char s[10];
  cin >> s;
  n = (s[1] - 48) * 10 + s[0] - 48;
  m = (s[3] - 48) * 10 + s[4] - 48;
  if (n > m && n < 60) {
    cout << s[0] << s[1] << ":" << s[1] << s[0];
  } else {
    n = (s[0] - 48) * 10 + s[1] - 48;
    n++;
    if (n >= 24) {
      n -= 24;
    }
    if (n % 10 >= 6 && n % 10 <= 9) {
      n = (n / 10 + 1) * 10;
    }
    if (n >= 24) {
      n -= 24;
    }
    if (n >= 10) {
      cout << n << ":" << n % 10 << n / 10;
    } else {
      cout << 0 << n << ":" << n << 0;
    }
  }
  cout << endl;
}
