#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  char a;
  cin >> h;
  cin >> a;
  cin >> m;
  m = m + 1;
  if (m == 60) {
    m = 0;
    if (h != 23)
      h = h + 1;
    else
      h = 0;
  }
  while (true) {
    int k = 10 * (m % 10) + (m / 10) % 10;
    if (k == h) {
      if (h == 0 && m == 0)
        cout << "00:00";
      else if (h < 10)
        cout << "0" << h << ":" << m;
      else if (m < 10)
        cout << h << ":0" << m;
      else
        cout << h << ":" << m;
      break;
    } else {
      m = m + 1;
      if (m == 60) {
        m = 0;
        if (h != 23)
          h = h + 1;
        else
          h = 0;
      }
    }
  }
}
