This page is still under construction.

Parts of this page are still being built. What you see may change.

Time Card

Interview

Time limit1sMemory limit128 MB

Summary
Given clock-in and clock-out times for three employees in h m s form, print each employee's working duration as hours, minutes, and seconds.
Level

Easy2 of 10

Topics
Math, Implementation, Simulation
Solved
No attempts yet

Problem

A company tracks its employees' working hours with time cards. When an employee arrives, they record their clock-in time on the time card; when they leave, they record their clock-out time. Times use the 24-hour clock.

For security reasons, every employee clocks in at or after 7 o'clock, and every employee clocks out before 23 o'clock. Also, the clock-out time is always later than the clock-in time.

Given the clock-in and clock-out times of three employees A, B, and C, write a program that computes each employee's working time.

Input

The input consists of three lines.

  • The first line contains employee A's clock-in time and clock-out time,
  • the second line contains employee B's clock-in time and clock-out time,
  • the third line contains employee C's clock-in time and clock-out time.

Each time is written as three space-separated integers hh, mm, ss, meaning hh hours mm minutes ss seconds. (7≤h≤227 \le h \le 22, 0≤m≤590 \le m \le 59, 0≤s≤590 \le s \le 59)

Thus each line contains six space-separated integers: the clock-in time followed by the clock-out time.

Output

Print three lines.

  • The first line contains employee A's working time,
  • the second line contains employee B's working time,
  • the third line contains employee C's working time.

If the working time is hh hours mm minutes ss seconds, print hh, mm, ss separated by spaces in that order.

Examples1

  1. Example 1

    Input
    9 0 0 18 0 0
    9 0 1 18 0 0
    12 14 52 12 15 30
    
    Expected output
    9 0 0
    8 59 59
    0 0 38