Two cars crashed on a road, each taking some damage, raising the usual question: "Who is to blame?" To answer it, the sequence of events must be reconstructed precisely. By gathering witness testimony and analyzing tire tracks, the positions and speeds of the cars just before the impact were determined. From those positions until the crash, each car moved straight ahead in its own forward direction.
Given this data, write a program that determines, for each car, which of its parts first came into contact with the other car. The parts are numbered as shown in the figure below.

View each car as a rectangle seen from above. Its perimeter is split at the midpoints of the four sides; each corner, together with the portions of the two adjacent sides up to their midpoints, forms one part. Relative to the driving direction the parts are numbered: 1 = back-left, 2 = front-left, 3 = front-right, 4 = back-right corner.
The input contains twelve floating point numbers x1,y1,u1,v1,w1,s1,x2,y2,u2,v2,w2,s2. For each car, (x,y) and (u,v) are the coordinates of the back-left and forward-left corners, w is the width of the car, and s is its speed. The car's forward direction points from the back-left corner to the forward-left corner, and the width is measured to the right of that direction.
Output two integers p1,p2, where pi is the number of the part of car i that first came into contact with the other car. If two parts come into contact simultaneously, output the smaller part number.