#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int h = (10 * (s[0] - '0')) + (s[1] - '0');
  int m = (10 * (s[3] - '0')) + (s[4] - '0');
  if (h > 22 && m > 31) {
    cout << "00:00" << endl;
  } else {
    int mmi = 10 * ((h) % 10) + (h) / 10;
    if (m >= mmi) {
      int mm = 10 * ((h + 1) % 10) + (h + 1) / 10;
      while (mm > 59) {
        h = h + 1;
        mm = 10 * ((h + 1) % 10) + (h + 1) / 10;
      }
      if (h + 1 > 9) {
        printf("%d%c", h + 1, ':');
      } else {
        printf("%d%d%c", 0, h + 1, ':');
      }
      printf("%d%d", (h + 1) % 10, (h + 1) / 10);
    } else {
      int mm = 10 * ((h) % 10) + (h) / 10;
      while (mm > 59) {
        h = h + 1;
        mm = 10 * ((h) % 10) + (h) / 10;
      }
      if (h > 9) {
        printf("%d%c", h, ':');
      } else {
        printf("%d%d%c", 0, h, ':');
      }
      printf("%d%d", (h) % 10, (h) / 10);
    }
  }
  return 0;
}
