문제
Bessie is going on a hiking excursion! The trail that she is currently traversing consists of
There are
For each of
입력
The first line contains
Each of the next
출력
예제1
7 6
4 1 2 3
4 10 5 6
2 100 7 7
6 1000 1 1
5 10000 1 4
6 100000 5 6
-1
-1
-1
1111
10100
110100
-1
If Bessie starts at checkpoint
Purchase the first ticket at checkpoint
Purchase the third ticket at checkpoint
Return to checkpoint
Purchase the fourth ticket at checkpoint