#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, M;
  while (~scanf("%d:%d", &H, &M)) {
    int m = H * 60 + M;
    for (m++;; m++) {
      m %= 24 * 60;
      int th = m / 60, tm = m % 60;
      if ((th % 10) * 10 + th / 10 == tm) {
        printf("%02d:%02d\n", th, tm);
        break;
      }
    }
  }
  return 0;
}
