https://www.acmicpc.net/problem/2884
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int h=s.nextInt();
int m=s.nextInt();
m-=45;
if(m<0){
h--;
m+=60;
}
if(h<0) h=23;
System.out.format("%d %d",h,m);
}
}