import java.util.*; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String t = in.next(); int h = Integer.parseInt(t.substring(0,2)); int m = Integer.parseInt(t.substring(3,5)); if(m >= 55) { m = m + 5 - 60; if(h == 23) h = 0; else h++; } else { m += 5; } String ans = String.format("%02d:%02d", h, m); System.out.println(ans); } }