import sys
def next(s, str, list):
global i1
i0 = i1 + 1
i1 = s.find(str, i0)
if (i1 == -1): i1 = len(s)
list.append(int(float(s[i0:i1])))
return i1 == len(s)
i1 = 0
lines = []
for s in sys.stdin:
l = []
i1 = s.find("d=\"m ")
if (i1 == -1): continue
i1 = s.find(" ", i1)
ends = s.find("\"", i1)
s = s[i1 : ends]
i1 = 0
next(s, ",", l)
next(s, " ", l)
l[0] = 5000 + l[0]
l[1] = 5000 - l[1]
lines.append([l[0], l[1], 0, 0])
while (True):
l = []
next(s, ",", l)
done = next(s, " ", l)
l[0] = lines[-1][0] + l[0]
l[1] = lines[-1][1] - l[1]
lines[-1][2] = l[0]
lines[-1][3] = l[1]
if (done): break
lines.append([l[0], l[1], 0, 0])
x0 = lines[-1][0]
y0 = lines[-1][1]
for i in range(len(lines)):
lines[ i ][0] -= x0
lines[ i ][2] -= x0
lines[ i ][1] -= y0
lines[ i ][3] -= y0
for j in range(4): lines[ i ][ j ] *= 10
for l in lines:
print("L %d %d %d %d *" % (l[0], l[1], l[2], l[3]))
aW1wb3J0IHN5cwoKZGVmIG5leHQocywgc3RyLCBsaXN0KToKICAgIGdsb2JhbCBpMQogICAgaTAgPSBpMSArIDEKICAgIGkxID0gcy5maW5kKHN0ciwgaTApCiAgICBpZiAoaTEgPT0gLTEpOiBpMSA9IGxlbihzKQogICAgbGlzdC5hcHBlbmQoaW50KGZsb2F0KHNbaTA6aTFdKSkpCiAgICByZXR1cm4gaTEgPT0gbGVuKHMpCgppMSA9IDAKbGluZXMgPSBbXQpmb3IgcyBpbiBzeXMuc3RkaW46CiAgICBsID0gW10KICAgIGkxID0gcy5maW5kKCJkPVwibSAiKQogICAgaWYgKGkxID09IC0xKTogY29udGludWUKICAgIGkxID0gcy5maW5kKCIgIiwgaTEpCiAgICBlbmRzID0gcy5maW5kKCJcIiIsIGkxKQogICAgcyA9IHNbaTEgOiBlbmRzXQogICAgaTEgPSAwCiAgICBuZXh0KHMsICIsIiwgbCkKICAgIG5leH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TAmcXVvdDsgeD0mcXVvdDs2MCZxdW90OyB5PSZxdW90OzE0MDAmcXVvdDsvJmd0OwombHQ7L3N2ZyZndDs=
<svg version="1.1"
xmlns:xlink="http://w...content-available-to-author-only...3.org/1999/xlink"
xmlns="http://w...content-available-to-author-only...3.org/2000/svg">
<path d="m 100,682.36218 80,90 80,50"
style="fill:none;stroke:#000000;stroke-width:1"/>
<path d="m 260,1022.3622 70,-90.00002 60,-40 80,-20 120,-10 210,-10"
style="fill:none;stroke:#000000;stroke-width:1"/>
<path d="m 100,1162.3622 100,-20 60,0"
style="fill:none;stroke:#000000;stroke-width:1"/>
<path d="m 60,852.36218 790,0"
style="fill:none;stroke:#000000;stroke-width:1"/>
<path d="m 60,1352.3622 790,0"
style="fill:none;stroke:#000000;stroke-width:1"/>
<rect width="10" height="10" x="60" y="600"/>
<rect width="10" height="10" x="60" y="1400"/>
</svg>