#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  char ch;
  cin >> h >> ch >> m;
  int a = h / 10, b = h % 10, c = m / 10, d = m % 10;
  if (b >= 5 && a == 0) {
    cout << "10:01" << endl;
    return 0;
  }
  if (b >= 5 && a == 1) {
    cout << "20:02" << endl;
    return 0;
  }
  if (m > (b * 10 + a)) {
    h += 1;
    h = h % 24;
    int k = h / 10, l = h % 10;
    cout << k << l << ":" << l << k << endl;
    return 0;
  }
  if (m == (b * 10 + a)) {
    cout << a << b + 1 << ":" << b + 1 << a << endl;
    return 0;
  }
  if (m < (b * 10 + a)) {
    cout << a << b << ":" << b << a;
    return 0;
  }
}
