Handy Smurf created his newest invention: nanobot calendar. It obviously consists of nanobots showing current date. Every day in order to switch current date they have to perform a cyclic rotation by k places (so that nanobot that was initially at position i is now at position (i+k)modn, nanobots are indexed from 0). However, nanobots can only understand one command: reverse lr which reverses positions of all nanobots at positions between l and r (so that nanobot that was initially at position l is now at r, the one that was at l+1 is now at r−1 and so on). Help Handy write an algorithm for updating the date with minimum number of commands issued.
First and only line of input contains two integers n and k (1≤n≤109, 0≤k<n), specifying the number of nanobots and number of places to rotate.
First line of output should contain integer m -- the number of reverse commands used. On each of the next m lines output two integers a and b (0≤a≤b<n) which means that the next command is reverse ab.