#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int h, m;
  scanf("%d %d", &h, &m);
  printf("%d %d\n", m / 60, (m = ((m + 60 * h - 45) + 1440) % 1440) % 60);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%eax
imul   $0x3c,-0x8(%rbp),%ecx
add    %ecx,%eax
sub    $0x2d,%eax
add    $0x5a0,%eax
mov    $0x5a0,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x3c,%ecx
cltd
idiv   %ecx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movslq (%rsp),%rax
imul   $0xffffffff88888889,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0x5,%esi
add    %ecx,%esi
imul   $0x3c,0x4(%rsp),%ecx
lea    (%rax,%rcx,1),%edx
add    %ecx,%eax
add    $0x573,%eax
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %edx,%ecx
add    $0x573,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xa,%ecx
add    %edx,%ecx
imul   $0x5a0,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%rsp)
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x3c,%edx,%ecx
sub    %ecx,%eax
movswl %ax,%edx
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 60
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = mul nsw i32 60, %8
%10 = add nsw i32 %7, %9
%11 = sub nsw i32 %10, 45
%12 = add nsw i32 %11, 1440
%13 = srem i32 %12, 1440
store i32 %13, i32* %3
%14 = srem i32 %13, 60
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 60
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 60
%10 = add i32 %6, 1395
%11 = add i32 %10, %9
%12 = srem i32 %11, 1440
store i32 %12, i32* %2
%13 = trunc i32 %12 to i16
%14 = srem i16 %13, 60
%15 = sext i16 %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %15)
ret i32 0
}