#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  static int h, m, r, i;
  cin >> s;
  h = (s[0] - 48) * 10 + (s[1] - 48);
  m = (s[3] - 48) * 10 + (s[4] - 48);
  r = (s[1] - 48) * 10 + (s[0] - 48);
  if (r > m && r < 60)
    printf("%02d:%d", h, r);
  else {
    if (h >= 15 && h <= 18)
      h = 20;
    else if (h >= 5 && h <= 8)
      h = 10;
    else if (h == 23)
      h = 0;
    else
      h++;
    printf("%02d:", h);
    for (i = 0; i < 2; i++, h /= 10) printf("%d", (h % 10));
  }
  return 0;
}
