a = int(input())
b = a // 3600
c = a % 3600
m = c // 60
s = c % 60
print(str(b)+" "+str(m)+ " " +str(s))