fork download
  1. # your code goes here
  2. A, B, C = map(int, input().split())
  3. D = int(input())
  4.  
  5. D_sec = D%60
  6. D_min = (D//60)%60
  7. D_hour = ((D//60)//60)%60
  8.  
  9. A += D_hour
  10. B += D_min
  11. C += D_sec
  12.  
  13. B += C // 60
  14. C %= 60
  15. A += B // 60
  16. B %= 60
  17. A %= 24
  18.  
  19.  
  20. print(A, B, C)
  21.  
Success #stdin #stdout 0.03s 9788KB
stdin
14 0 0
367890
stdout
8 11 30