#include <bits/stdc++.h>
using namespace std;
void Panda() {
  vector<pair<long long int, long long int>> palins;
  for (long long int i = 0, j = 0; i < 6, j < 51; i++, j += 10)
    palins.push_back(make_pair(i, j));
  for (long long int i = 10, j = 1; i < 16, j < 52; i++, j += 10)
    palins.push_back(make_pair(i, j));
  for (long long int i = 20, j = 2; i < 24, j < 33; i++, j += 10)
    palins.push_back(make_pair(i, j));
  string s;
  cin >> s;
  pair<long long int, long long int> check = {((s[0] - '0') * 10) + s[1] - '0',
                                              ((s[3] - '0') * 10) + s[4] - '0'};
  bool isFound = false;
  for (auto i : palins) {
    if ((check.first < i.first) ||
        (check.first == i.first) && (check.second < i.second)) {
      isFound = true;
      check = i;
      break;
    }
  }
  if (isFound) {
    if (check.first <= 9)
      cout << "0" << check.first << ":";
    else
      cout << check.first << ":";
    if (check.second <= 9)
      cout << "0" << check.second << '\n';
    else
      cout << check.second << '\n';
  } else
    cout << "00:00" << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  ;
  cin.tie(NULL);
  cout.tie(NULL);
  Panda();
  return 0;
}
