Manao has invented a new mathematical term — a beautiful set of points. He calls a set of points on a plane beautiful if it meets the following conditions:
 1.  The coordinates of each point in the set are integers. 1.  For any two points from the set, the distance between them is a non-integer. 
Consider all points (*x*, *y*) which satisfy the inequations: 0 ≤ *x* ≤ *n*; 0 ≤ *y* ≤ *m*; *x* + *y* &gt; 0. Choose their subset of maximum size such that it is also a beautiful set of points.
The single line contains two space-separated integers *n* and *m* (1 ≤ *n*, *m* ≤ 100).
import sys
input = lambda: sys.stdin.readline().rstrip()

N,M = map(int, input().split())

K = min(N,M)+1
A = [[0]*K for _ in range(K)]
for i in range(K):
    A[i][i] = 1
t = A.pop()
A = [t]+A

print(K)
for i in range(K):
    for j in range(K):
        if A[i][j]:
            print(i,j)