#include <bits/stdc++.h>
using namespace std;
bool isPalin(int mins) {
  int hr = mins / 60;
  int minu = mins % 60;
  return hr / 10 == minu % 10 and hr % 10 == minu / 10;
}
void print(int mins) {
  if (mins / 60 < 10) cout << 0;
  cout << mins / 60 << ":";
  if (mins % 60 < 10) cout << 0;
  cout << mins % 60;
}
void solve() {
  string s;
  cin >> s;
  int hr = (s[0] - '0') * 10 + (s[1] - '0');
  int minu = (s[3] - '0') * 10 + (s[4] - '0');
  int mins = minu + hr * 60;
  while (true) {
    mins = mins + 1;
    mins %= 1440;
    if (isPalin(mins)) {
      print(mins);
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
