C. Laser CNC - Lines

After receiving the CNC, you realize the software supplied by the vendor will not meet the high requirements mandated by the complexity of the anti-zombie weapon technology. You decide to reimplement the system piece by piece, always testing your new tools against the supplied demo designs.

Your first task is to reimplement the lowest level driver that renders vector graphics into (slightly) optimized laser CNC scripts.

   bicycle mask
source: http://www.wpclipart.com/recreation/cycling/bicycles/plain_bicycle_icon_large.png.html

Input

The first line of input contains integers N and T, followed by N lines each describing a cut with integer coordinates X1 Y1 X2 Y2. The submitted solution is accepted only if it finishes cutting all lines within T seconds.

Output

A laser script that cuts all N lines precisely:

The evaluator will render the pixmap of the cut (C), keep only pixel values of total cut (white, value 255) and will compare it to the pixmap of the reference solution (R). Our reference output (R) is also provided in png format among the input files.

First R is compared to a bloated version of the C - all white pixels of R must be a white pixel of the bloated C. Then the same test is repeated in reverse order (R is bloated and matched against the original render of C.

Bloating is a special case of blur: the input image is copied to a new image so that each pixel of the new image is white if and only if the 5*5 pixel rectangle centered at the original pixel contains at least one white pixel.

Example input

4 100
100 100 100 400
100 400 300 400
300 400 300 100
300 100 100 100

Example output

bd=2000
dd=0
dx=120
dy=120
tx=100
ty=100
pwm=0
start
dx=450
dy=450
tx=300
pwm=1023
start
ty=400
start
tx=100
start
ty=100
start
pwm=0
start
end