#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(){
  string T;
  cin >> T;
  int a[5];
  for(size_t i=0; i<T.size();i++){
    a[i] = T[i] - '0';
  }
  int h = 10*a[0] + a[1];
  int m = 10*a[3] + a[4];

  if(m+5 >= 60){
    m = (m+5) % 60;
    if(h + 1 == 24){
      cout << "00:" << "0" << to_string(m) << endl;
    }else{
      h += 1;
      if(h < 10){
        cout << "0" << to_string(h) << ":0" << to_string(m) << endl;
      }else{
        cout << to_string(h) << ":0" << to_string(m) << endl;
      }
    }
  }else{
    m += 5;
    if(m < 10){
      cout << T[0] << T[1] << ":0" << to_string(m) << endl;
    }else{
      cout << T[0] << T[1] << ":" << to_string(m) << endl;
    }
  }
  return 0;
}