G. Ski Obstacle Course
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

With twenty years of professional skiing under his belt, Johnny decides to take his skills to the next level at the annual Ski-Bidi obstacle course.

The Ski-Bidi obstacle course this year lies on a large hill with a length of $$$n$$$ feet and $$$m$$$ lanes. In other words, it can be thought of as an $$$n$$$ by $$$m$$$ grid. On the hill, there are $$$k$$$ obstacles, where the $$$i$$$-th obstacle lies at $$$(r_i, c_i)$$$.

Johnny is allowed to start at the top of the hill at any lane – that is, any point of the form $$$(1, c)$$$ where $$$1 \le c \le m$$$. In one second, he moves down the hill by $$$1$$$ foot and can either stay in the current lane or move to an adjacent lane as long as he does not collide with an obstacle. In other words, Johnny can move from $$$(r, c)$$$ to $$$(r + 1, c)$$$, $$$(r + 1, c - 1)$$$, or $$$(r + 1, c + 1)$$$, as long as his new location does not lie on an obstacle or leaves the grid.

As Johnny wants to finish in style, he wants to know what lanes he can end the obstacle course in. In particular, after $$$n - 1$$$ seconds, which lanes can Johnny be in?

Input

The first line contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le m \le 10^5$$$, $$$1 \le k \le 2 \cdot 10^5$$$) – the length of the obstacle course, the number of lanes in the obstacle course, and the number of obstacles, respectively.

The next $$$k$$$ lines each contain two integers, with the $$$i$$$-th line containing $$$r_i$$$ and $$$c_i$$$ ($$$2 \le r_i \le n$$$, $$$1 \le c_i \le m$$$) – the location of the $$$i$$$-th obstacle. It is guaranteed that the locations of the obstacles are distinct.

Output

On the first line, output the number of lanes that Johnny can end the obstacle course in. On the second line, output the aforementioned lanes as an increasing list of space-separated integers.

Examples
Input
4 3 2
3 1
3 2
Output
2
2 3
Input
4 4 6
2 2
2 3
2 4
4 1
4 2
4 3
Output
0
Note

In the first sample test case, in order to reach the end of the obstacle course, Johnny must be in lane $$$3$$$ after skiing for two seconds. He is then free to move to either lane $$$2$$$ or stay in lane $$$3$$$ at the end of the obstacle course.

In the second sample test case, Johnny cannot reach the end of the obstacle course, as doing so would require moving from lane $$$1$$$ to lane $$$4$$$ in $$$2$$$ seconds.