#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m;
  char c;
  while (cin >> h >> c >> m) {
    if (h >= 6 && h <= 9)
      cout << "10:01" << endl;
    else if (h >= 16 && h <= 19)
      cout << "20:02" << endl;
    else {
      int ch = h;
      int temp = 0;
      temp += (ch % 10) * 10;
      ch /= 10;
      temp += ch;
      if (temp > m) {
        if (h < 10) cout << "0";
        cout << h << ":";
        if (temp < 10) cout << "0";
        cout << temp << endl;
      } else {
        if (h == 23)
          h = 0;
        else
          h++;
        if (h >= 6 && h <= 9)
          h = 10;
        else if (h >= 16 && h <= 19)
          h = 20;
        if (h < 10) cout << "0";
        cout << h << ":";
        temp = 0;
        temp += 10 * (h % 10);
        h /= 10;
        temp += h;
        if (temp < 10) cout << "0";
        cout << temp << endl;
      }
    }
  }
  return 0;
}
