fork(1) download
  1. A,B =map(int,input().split())
  2. C=int(input())
  3. if(B + C >60):
  4. A= A + ((B+C)//60)
  5. B = (B+C)%60
  6. else:
  7. B= B+C
  8.  
  9. if(A>=24): A= A%24
  10.  
  11. print(f"{A} {B}")
Success #stdin #stdout 0.03s 9832KB
stdin
23 00
60
stdout
23 60