#include <bits/stdc++.h>
bool ispali(int hh, int mm) {
  int m1 = mm % 10;
  int m2 = mm / 10;
  return hh == m1 * 10 + m2;
}
std::map<std::pair<int, int>, int> mpPali;
std::vector<std::pair<int, int> > vePali;
void Init() {
  int cnt = 0;
  for (int i = 0; i < 24; ++i) {
    for (int j = 0; j < 60; ++j) {
      if (ispali(i, j)) {
        mpPali.insert(std::make_pair(std::make_pair(i, j), cnt));
        vePali.push_back(std::make_pair(i, j));
        ++cnt;
      }
    }
  }
  mpPali.insert(std::make_pair(std::make_pair(0, 0), cnt));
  vePali.push_back(std::make_pair(0, 0));
}
int main() {
  int hh, mm;
  int rhh, rmm;
  Init();
  while (scanf("%2d:%2d", &hh, &mm) != EOF) {
    std::pair<int, int> time = std::make_pair(hh, mm);
    unsigned int i = -1;
    for (i = 0; i < vePali.size(); ++i) {
      if (vePali[i] > time) {
        rhh = vePali[i].first;
        rmm = vePali[i].second;
        break;
      }
    }
    if (i == vePali.size()) {
      rhh = vePali[0].first;
      rmm = vePali[0].second;
    }
    printf("%02d:%02d\n", rhh, rmm);
  }
  return 0;
}
