#include <bits/stdc++.h>
using namespace std;
class UFDS {
 private:
  vector<int> p, rank, setSize;
  int numSets;

 public:
  UFDS(int n) {
    setSize.assign(n, 1);
    numSets = n;
    rank.assign(n, 0);
    p.assign(n, 0);
    for (int i = 0; i < n; i++) p[i] = i;
  }
  int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
  bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
  void unionSet(int i, int j) {
    if (!isSameSet(i, j)) {
      numSets--;
      int x = findSet(i), y = findSet(j);
      if (rank[x] > rank[y]) {
        p[y] = x;
        setSize[x] += setSize[y];
      } else {
        p[x] = y;
        setSize[y] += setSize[x];
        if (rank[x] == rank[y]) rank[y]++;
      }
    }
  }
  int numDisjointSets() { return numSets; }
  int sizeOfSet(int i) { return setSize[findSet(i)]; }
};
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int h, m;
  char c;
  cin >> h >> c >> m;
  while (1) {
    m++;
    h += m / 60;
    m %= 60;
    h %= 24;
    if (h / 10 == m % 10 && h % 10 == m / 10) break;
  }
  cout << h / 10 << h % 10 << ':' << m / 10 << m % 10;
  return 0;
}
