eolymp
bolt
Try our new interface for solving problems
Problems

Secular reception

Secular reception

Agent Johnny English is back in business!

This time, the intrepid agent and his assistant Bof need to keep order during a charity event. Entering the hall and assessing the situation, English realized that in order to get a complete picture of what was happening, he would have to walk around the hall a bit, exchange a few words with the guests and watch the waiters. After that, English, believing in success, decided to meet with Bof and show off his incredible analytical skills in front of him. Unfortunately, poor Bough gets completely lost at social events and can just walk slowly where the senior agent tells him to go.

The hall is a square on the coordinate plane with sides equal to 106 and parallel to the coordinate axes, the entrance is in the lower left corner of this square at point O(0, 0). Agent English is going to select several guests located at points with integer coordinates and greet them all in turn. The agent will not greet the same guest in a row, but sometimes his memory can fail him, and he can return to the guest with whom he has already greeted. A trained agent is able to move at p speed and greet guests instantly. At this time, Bof with a speed of q will go directly to the final point of the route conceived by English.

In order not to cause a suspicion, Agent English wants to find a route that will get him and Bough to the meeting point at the same time. Unfortunately, the agent does not have time to think through the details of his brilliant plan, and therefore it will be up to you to do this.

Given speeds q and p, find any route starting from the point (0, 0) and containing points which coordinates are non-negative and do not exceed 106. In this case, the time of movement from the first point to the last one with the speed q must be equal to the time of successive passage of the route with the speed p.

Input

One line contains two positive integers q and p (1qp105) - the speeds of Boff and agent English respectively .

Output

In the first line print the number of points n (2n100) in the route. In the next n lines print pairs of integers x and y (0x, y106) - the point's coordinates in traversal order. The point (0, 0) must be printed first. Points can be repeated, and there cannot be two identical points in a row in a route.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1 2
Output example #1
4
0 0
2 0
2 1
2 0
Input example #2
1 3
Output example #2
4
0 0
2 0
2 2
2 0
Source 2018 Цикл Интернет-олимпиад для школьников, первая командная олимпиада сезона, 14 октября, Задача J