The first line has two integers .The second line has integers which denote .Then there are lines, the i-th line has three integers which represents the i-th query.
There are lines, the i-th line has one integer which denotes .
3 3 1 2 3 0 4 1 0 4 2 0 4 3
0 1 2
5 4 0 1 2 3 4 2 3 4 4 5 1 2 2 3 1 4 5
3 0 2 5