You are an adventurer working for the futuristic corporation RoboCorp. Your initial skill level is an integer in the range $$$[1, n]$$$, but you don't know its exact value. Your goal is to reach a skill level of at least $$$n$$$ by completing missions for RoboCorp, but each mission costs precious robocoins.
You can choose missions of any difficulty and any positive integer duration (in hours). However, the cost depends both on the new mission's length, and on how the new mission's difficulty compares to your most recent one.
Let $$$x$$$ be the difficulty of your most recent mission. If you want to undertake a new mission of difficulty $$$y$$$ and duration $$$l$$$:
Your skill improves only when you take on a mission whose difficulty $$$y$$$ exactly matches your current skill $$$s$$$:
After each mission, you still don't know your actual skill value.
You start with $$$10^6$$$ robocoins. Find a strategy (a sequence of missions) that does not exceed your budget and guarantees your skill becomes at least $$$n$$$, no matter what your initial skill was.
The input contains a single line with an integer $$$n$$$ ($$$1 \leq n \leq 250\,000$$$) — the target skill level (that is, by the end, your skill must be greater or equal to $$$n$$$).
In the first line, print a single integer $$$k$$$ ($$$0 \leq k \leq 10^6$$$) — the number of missions you plan to complete.
Then, print $$$k$$$ lines. The $$$i$$$-th line must contain two integers $$$y$$$ and $$$l$$$ ($$$1 \leq y, l \leq 10^6$$$) — the difficulty and duration (in hours) of the $$$i$$$-th mission, respectively.
4
4 1 4 3 1 2 1 3 1
Explanation of sample 1. In the example, your target skill is $$$n = 4$$$. You can use the following strategy:
In total, you spend $$$2007$$$ robocoins, which is within your $$$10^6$$$-robocoin budget.
Now we verify that this strategy always works:
So no matter what your starting skill is, you end with skill $$$\geq n$$$.