#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e10;
const long long mod = 1e9 + 7;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long M = 200 + 10;
const long long N = 10 * 100 + 10;
bool ok(int a, int b) {
  string s;
  if (a < 10) s.push_back('0');
  s += to_string(a);
  if (b < 10) s.push_back('0');
  s += to_string(b);
  string t = s;
  reverse(s.begin(), s.end());
  return s == t;
}
int main() {
  faster();
  int a, b;
  char trash;
  cin >> a >> trash >> b;
  while (1) {
    b++;
    a += b / 60;
    b %= 60;
    a %= 24;
    if (ok(a, b)) break;
  }
  if (a < 10) cout << "0";
  cout << a << ":";
  if (b < 10) cout << "0";
  cout << b << endl;
}
