#include <bits/stdc++.h>
using namespace std;
int main() {
  string time;
  cin >> time;
  int h1 = (int)time[0] - 48;
  int h2 = (int)time[1] - 48;
  int m1 = (int)time[3] - 48;
  int m2 = (int)time[4] - 48;
  int hours = 10 * h1 + h2;
  int minutes = 10 * m1 + m2;
  if (hours == 5) {
    if (minutes < 50) {
      cout << "05:50";
      return 0;
    } else {
      cout << "10:01";
      return 0;
    }
  }
  if (hours >= 6 && hours <= 9) {
    cout << "10:01";
    return 0;
  }
  if (hours > 15 && hours < 20) {
    cout << "20:02";
  } else if (hours == 15) {
    if (minutes >= 51) {
      cout << "20:02";
    } else {
      cout << "15:51";
    }
  } else if (hours < 15 || hours > 20 && hours != 23) {
    if (minutes < 10 * h2 + h1) {
      string h;
      string m;
      if (hours / 10 == 0) {
        h = to_string(0) + to_string(hours);
      } else {
        h = to_string(hours);
      }
      if ((10 * h2 + h1) / 10 == 0) {
        m = to_string(0) + to_string(10 * h2 + h1);
      } else {
        m = to_string(10 * h2 + h1);
      }
      cout << h << ":" << m;
    } else {
      string h;
      string m;
      if ((hours + 1) / 10 == 0) {
        h = to_string(0) + to_string(hours + 1);
      } else {
        h = to_string(hours + 1);
      }
      if ((10 * (h2 + 1) + h1) / 10 == 0) {
        m = to_string(0) + to_string(10 * (h2 + 1) + h1);
      } else {
        m = to_string(10 * (h2 + 1) + h1);
      }
      cout << h << ":" << m;
    }
  } else {
    if (minutes < 32) {
      cout << "23:32";
    } else {
      cout << "00:00";
    }
  }
}
