n = int(input()) h = n // 3600 m = (n - 3600 * h ) // 60 s = (n - 3600 * h ) % 60 print(f"{h} {m} {s}")