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).
from collections import deque
import math

mod = 10**9 + 7
fact = [1] * (2*10**5+10)
inf = 10**18

def gcd(a, b):
    while a > 0 and b > 0:
        if a >= b:
            a %= b
        else:
            b %= a
    return max(a, b)

def nok(a, b):
    return a * b // gcd(a, b)

def is_prime(a):
    for i in range(2, int(a**(1/2)) + 1):
        if a % i == 0:
            return False
    return True

def razl(a):
    res = []
    for i in range(2, int(a**(1/2)) + 1):
        while a % i == 0:
            res.append(i)
            a //= i
    if a != 1:
        res.append(a)
    return res

def is_prime_big(a):
    if pow(a-1, a-1, a) == 1:
        return True
    else:
        return False
def get_ret(n, mod):
    return pow(n, mod-2, mod)

for i in range(2, len(fact)):
    fact[i] = (fact[i-1] * i) % mod

def ck(n, k):
    return fact[n] * get_ret(fact[n-k] * fact[k])

def prog(start, finish, d):
    kol = (finish - start) // d + 1
    return (start + finish) * kol // 2

def to_bin(a):
    res = []
    while a > 0:
        res.append(a % 2)
        a //= 2
    res.reverse()
    return res

def to_dec(a):
    return sum([a[i] * pow(2, len(a) - i - 1) for i in range(len(a))])

def I():
    return int(input())

def II():
    return [int(i) for i in input().split()]

def IS():
    return [int(i) for i in input()]

def calc_sum(pref, a, l, r):
    return pref[r] - pref[l] + a[l]

def main():
    n, m = II()
    print(min(n, m) + 1)
    for i in range(min(n, m) + 1):
        print(i, i)




if __name__ == "__main__":
    main()

