VRt Contest 2019 (marathon)


A2. Collaboration
time limit per test: 15 seconds
memory limit per test: 768 megabytes
input: standard input
output: standard output

Examples
Input
4
5 15 0 0 0 0
2 13 30 2 200 400
3 12 29 1 350 600
39 21 9 4 671 757
Output
start 335 1
arrive 340 2
work 340 370 2
arrive 372 3
work 372 401 3
arrive 406 1
end
start 335 1
arrive 340 2
work 340 370 2
arrive 375 1
end
----------------------------------------------------------------------------------------------------
