Do you remember Kanna-chan we met last year? She is so cute, and this year, she entered middle school, with Cirno. As we know, Cirno is bad at math, so she had trouble when studying physics.
Today, Kanna-chan's teacher is preparing for mid-term exam, one of the problem looks like follows:
Please calculate the equivalent resistance of the circuit below.
As Kanna-chan's teacher is too lazy, so he asked you for help, he will give you the answer of the problem, and your task is to generate a valid circuit satisfies that it's equivalent resistance equals to the answer.
Input contains one line with two integers, p and q, means the answer of the problem should be p/q, where
,
.
Output a circuit satisfy teacher's request. The first line of your input should be two integers, n and m, n is the number of nodes and m is the number of resistance you used. Where
Then m lines follows, each line contains three integers,
,which means that there is a wi-Ohm resistance connected between ui and vi,
, multiple resistances can be used between two nodes.
Then output two integers s, t,
, means that the equivalent resistance between node s and node t equals to p/q.