#include <bits/stdc++.h>
using namespace std;
int power_calculation(int b, int p) {
  int ans = b;
  for (int i = 1; i < p; i++) ans *= b;
  return ans;
}
int count_digit(int n) {
  int r, cnt = 0;
  while (n) {
    r = n % 10;
    n /= 10;
    cnt++;
  }
  return cnt;
}
int is_Pallindrome(int n) {
  int r, new_num = 0, mul = power_calculation(10, count_digit(n) - 1);
  while (n) {
    r = n % 10;
    n /= 10;
    new_num += r * mul;
    mul /= 10;
  }
  return new_num;
}
int main() {
  int h, m;
  scanf("%2d:%2d", &h, &m);
  if (h < 5) {
    if (m < h * 10)
      printf("0%d:%d\n", h, h * 10);
    else
      printf("0%d:%d\n", h + 1, (h + 1) * 10);
  } else if (h == 5) {
    if (m < 5 * 10)
      printf("0%d:%d\n", h, h * 10);
    else
      printf("10:01\n");
  } else if (h < 10)
    printf("10:01\n");
  else if (h == 10) {
    if (m < is_Pallindrome(h))
      printf("%d:0%d\n", h, is_Pallindrome(h));
    else
      printf("11:11\n");
  } else if (h < 15) {
    if (m < is_Pallindrome(h))
      printf("%d:%d\n", h, is_Pallindrome(h));
    else
      printf("%d:%d\n", h + 1, is_Pallindrome(h + 1));
  } else if (h == 15) {
    if (m < is_Pallindrome(h))
      printf("%d:%d\n", h, is_Pallindrome(h));
    else
      printf("20:02\n");
  } else if (h <= 19)
    printf("20:02\n");
  else if (h == 20) {
    if (m < is_Pallindrome(h))
      printf("%d:0%d\n", h, is_Pallindrome(h));
    else
      printf("%d:%d\n", h + 1, is_Pallindrome(h + 1));
  } else if (h == 21) {
    if (m < is_Pallindrome(h))
      printf("%d:%d\n", h, is_Pallindrome(h));
    else
      printf("%d:%d\n", h + 1, is_Pallindrome(h + 1));
  } else if (h == 22) {
    if (m < is_Pallindrome(h))
      printf("%d:%d\n", h, is_Pallindrome(h));
    else
      printf("00:00\n");
  } else if (h == 23) {
    if (m < is_Pallindrome(23))
      printf("23:32\n");
    else
      printf("00:00\n");
  }
  return 0;
}
