<?xml version="1.0" encoding="Windows-1251"?>
<CATS version="1.2">
<Problem title="Road Accident" lang="en"
  author="A. Klenin, T. Chistyakov"
  tlimit="1" mlimit="2" inputFile="input.txt" outputFile="output.txt" stdChecker="nums">

<Picture name="pic" src="car_acc.gif"/>

<ProblemStatement>
 <p>Two cars crashed on the road, receiving some damage each, and
 raising the usual question: "Who to blame?". To answer this, it is essential to
 thoroughly reconstruct the sequence of events. By gathering witness testimonies
 and analyzing tire tracks, positions and speeds of cars just before the impact
 were determined.
 From these positions until the crash the cars moved straight forward.
 </p><p>
 Your program must, given the available data, calculate for each car
 what part of it first came into contact with the other car. Parts are numbered as
 shown on the picture.
</p><p>
  <img picture="pic"/>
</p>
</ProblemStatement>

<ProblemConstraints>
$1 \le x_i, y_i, u_i, v_i, w_i \le 10^6, 0 \le s_i \le 10^6 $. 
Input data is such that a crash certainly happens. Initially cars don't have common points. 
</ProblemConstraints>

<InputFormat>
Input file contains twelve floating point numbers:
$x_1 y_1 u_1 v_1 w_1 s_1 x_2 y_2 u_2 v_2 w_2 s_2$, where $(x, y)$ and $(u, v)$ -- coordinates of
back-left and forward-left corners of the car, $w$ -- width of the car, $s$ -- speed of the car.
</InputFormat>

<OutputFormat>
Output file must contain two integers: $p_1 p_2$, where $p$ -- number of part which 
first contacted the other one (if two parts came into contact simultaneously,
output the lesser of the part numbers),
</OutputFormat>

<Sample rank="1">
  <SampleIn>1.0 2.0 10.0 2.0 1.0 10.0
50.0 1.0 40.0 1.0 1.0 20.0</SampleIn>
  <SampleOut>2 2</SampleOut>
</Sample>
<Sample rank="2">
  <SampleIn>1 1 10 1 1 20
40 1 50 1 1 10</SampleIn>
  <SampleOut>2 1</SampleOut>
</Sample>

<Solution name="sol" src="accident_tim.dpr"/>
<TestRange from="1" to="14"><In src="%0n"/><Out src="%0n.a"/></TestRange>

</Problem>
</CATS>
