import java.util.Scanner; class Main{ public static void main(String[]$) { Scanner s=new Scanner(System.in); int t=900+s.nextInt()*60+s.nextInt(); String v=s.next(); if(v.indexOf('.')==-1) v+=".0"; t+=Integer.parseInt(v.substring(3).replace(".",""))*6; t%=1440; System.out.printf("%02d:%02d\n",t/60,t%60); } }