문제
Farmer John's
Farmer John has come up with a new morning exercise routine for the cows. He has given the cows
For each
i from1 toM :The sequence of cows currently in positions
L_i \ldots R_i from the left reverse their order.
After the cows have repeated this process exactly
SCORING:
Test case 2 satisfies
N=K=100 .Test cases 3-5 satisfy
K\le 10^3 .Test cases 6-10 satisfy no additional constraints.
SAMPLE INPUT:
7 2 2
2 5
3 7SAMPLE OUTPUT:
1
2
4
3
5
7
6Initially, the order of the cows is
Problem credits: Brian Dean
입력
The first line contains
출력
On the