#include <bits/stdc++.h>
using namespace std;
int CI(string s) {
  int h = (s[0] - '0') * 10 + (s[1] - '0');
  int m = (s[3] - '0') * 10 + (s[4] - '0');
  return h * 60 + m;
}
int check(int a) {
  int h = a / 60, m = a % 60;
  return (m == (h % 10) * 10 + (h / 10));
}
string CS(int a) {
  string s = "**:**";
  int h = a / 60;
  int m = a % 60;
  s[0] = '0' + (h / 10);
  s[1] = '0' + (h % 10);
  s[3] = '0' + (m / 10);
  s[4] = '0' + (m % 10);
  return s;
}
int main() {
  string s;
  cin >> s;
  int x = CI(s);
  for (int i = 1; i < 24 * 60; i++) {
    int can = (x + i) % (24 * 60);
    if (check(can)) {
      cout << CS(can);
      return 0;
    }
  }
  cout << CS(x);
  return 0;
}
