#include <bits/stdc++.h>
using namespace std;
map<string, string> ma;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int l = 0, u = 0, n = 0, t, i = 0, d = 0, mx2 = -1, g = 0, mul = 1,
                m = 0, c = 0, x, y, j = 0, f = 0, k = 0, sum1 = 0, sum = 0,
                s = 0, mn = INT_MIN, mx = INT_MAX;
  string a;
  cin >> a;
  sum = (a[0] - '0') * 10 + (a[1] - '0');
  f = (sum % 10) * 10 + sum / 10;
  c = (a[3] - '0') * 10 + (a[4] - '0');
  if ((sum == 5 && c > 49) or (sum > 5 && sum < 10)) {
    cout << "10:01" << endl;
  } else if ((sum == 15 && c > 50) or (sum > 15 && sum < 20)) {
    cout << "20:02" << endl;
  } else if (f > c) {
    if (sum < 10) {
      cout << "0";
    }
    cout << sum << ":";
    if (f < 10) {
      cout << "0";
    }
    cout << f << endl;
  } else {
    sum++;
    sum %= 24;
    if (sum < 10) {
      cout << "0" << sum << a[2];
    } else
      cout << sum << a[2];
    cout << sum % 10 << sum / 10 << endl;
  }
  return 0;
}
