#include <bits/stdc++.h>
using namespace std;
long long h, m;
string str;
long long ulta() { return (str[1] - '0') * 10 + (str[0] - '0'); }
int main() {
  cin >> str;
  h = (str[0] - '0') * 10 + (str[1] - '0');
  m = (str[3] - '0') * 10 + (str[4] - '0');
  if (h < 10 and h > 5) {
    cout << "10:01" << endl;
    return 0;
  }
  if (h < 20 and h > 15) {
    cout << "20:02" << endl;
    return 0;
  }
  if (m < ulta()) {
    str[3] = str[1];
    str[4] = str[0];
    cout << str << endl;
  } else {
    h++;
    if (h < 10 and h > 5) {
      cout << "10:01" << endl;
      return 0;
    }
    if (h < 20 and h > 15) {
      cout << "20:02" << endl;
      return 0;
    }
    if (h == 24) {
      h = 0;
      str[0] = '0';
      str[1] = '0';
      str[3] = '0';
      str[4] = '0';
    } else {
      str[1] = ('0' + h % 10);
      h /= 10;
      str[0] = ('0' + h % 10);
      str[3] = str[1];
      str[4] = str[0];
    }
    cout << str << endl;
  }
  return 0;
}
