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
#sys.setrecursionlimit(10**7)
input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))
############ ---- Input Functions ---- ############

def Beautiful_Sets_of_Points():
    n, m = invr()

    num_points = min(n,m) + 1 

    outputStr = ''
    if n == min(n,m):

        start_x = n 
        start_y = 0 

        for i in range(num_points):
            outputStr += str(start_x) + ' ' + str(start_y) + '\n'
            start_x -= 1
            start_y += 1 
    
    else:
        start_x = 0 
        start_y = m 

        for i in range(num_points):
            outputStr += str(start_x) + ' ' + str(start_y) + '\n'
            start_x += 1
            start_y -= 1 
    
    outputStr = outputStr.strip()
    print(num_points)
    print(outputStr)
    return 


Beautiful_Sets_of_Points()