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:  The coordinates of each point in the set are integers.  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 > 0. Choose their subset of maximum size such that it is also a beautiful set of points.


-----Input-----

The single line contains two space-separated integers n and m (1 ≤ n, m ≤ 100).


-----Output-----

In the first line print a single integer — the size k of the found beautiful set. In each of the next k lines print a pair of space-separated integers — the x- and y- coordinates, respectively, of a point from the set.

If there are several optimal solutions, you may print any of them.


-----Examples-----
Input
2 2

Output
3
0 1
1 2
2 0

Input
4 3

Output
4
0 3
2 1
3 0
4 2



-----Note-----

Consider the first sample. The distance between points (0, 1) and (1, 2) equals $\sqrt{2}$, between (0, 1) and (2, 0) — $\sqrt{5}$, between (1, 2) and (2, 0) — $\sqrt{5}$. Thus, these points form a beautiful set. You cannot form a beautiful set with more than three points out of the given points. Note that this is not the only solution.

Difficulty: interview

Starter code:

Solutions:
s=min(list(map(int,input().split())))
print(s+1)
for i in range(s+1):print(i,s-i)


n, m = map(int, input().split())
k = min(n, m)
print(k + 1)
for i in range(k + 1):
    print(i, k - i)

import sys
n, m = map(int, input().split())
if m > n:
    print(n + 1)
    curr = (0, 1)
    while curr[0] <= n:
        print(curr[0],curr[1])
        curr = (curr[0] + 1, curr[1] + 1)
    return
if m == n:
    print(n + 1)
    curr = (0, n)
    while curr[0] <= n:
        print(curr[0],curr[1])
        curr = (curr[0] + 1, curr[1] - 1)
    return
print(m + 1)
curr = (1, 0)
while curr[1] <= m:
    print(curr[0],curr[1])
    curr = (curr[0] + 1, curr[1] + 1)

n, m = map(int, input().split())
k = min(n, m) + 1
print(k)
for i in range(k):
    print(i, k - i - 1)


n,m=list(map(int,input().split()))

print(min(n,m)+1)

for i in range(min(n,m)+1):
    if(m>n):
        print(i,m-i)
    else:
        print(n-i,i)



def main():
    n,m = [int(i) for i in input().split()]
    ans = []
    k = min(n,m)+1
    print(k)
    for i in range(k):
        print(i,k-i-1)
        
def __starting_point():
    main()

__starting_point()

n,m=list(map(int,input().split()))
s=min(m,n)+1
print(s)
for i in range(s):
    print( i, s-i-1)



a, b = (int(x) for x in input().split())
print(min(a, b) + 1)
for i in range(min(a, b) + 1):
	print(a - i, i)


n, m = [int(k) for k in input().split()]
minimum = min(m,n)
print(minimum+1)

points = [(0,m)]
x = 0
y = m
done = False
while  not done:
    x+=1
    y-=1
    points.append((x,y))
    if x == n or y == 0:
        done = True
for i in points:
    print(str(i[0]) + " " + str(i[1]))

n, m = map(int, input().split())
gemy = min(n, m)
gemy+=1
print(gemy)
for i in range(gemy):
    print(i, gemy-1 - i)

n, m = [int(x) for x in input().split()]
print(min(n, m) + 1)
for i in range(min(n, m) + 1):
    print(i, min(n, m)-i)


n,m = map(int, input().split())
print(min(n, m)+1)
for i in range(0,min(n,m)+1):
    print(i, abs(min(n,m)-i))

n, m = list(map(int, input().split()))
gemy = min(n, m)
gemy+=1
print(gemy)
for i in range(gemy):
    print(i, gemy-1 - i)


# coding=utf-8
n, m = list(map(int, input().split()))

a = min(n, m)
print(a + 1)
for i in range(a + 1):
    print(i, a - i)


n, m = list(map(int, input().split()))
lo = min([n, m])+1
print(lo)
for i in range(lo):
    print(i, lo-i-1)



def main():
    n = min(list(map(int, input().split())))
    print(n + 1)
    for x, y in zip(list(range(n + 1)), list(range(n, -1, -1))):
        print(x, y)


def __starting_point():
    main()

__starting_point()

import re, sys, string, operator, functools, fractions, collections
sys.setrecursionlimit(10**7)
dX= [-1, 1, 0, 0,-1, 1,-1, 1]
dY= [ 0, 0,-1, 1, 1,-1,-1, 1]
RI=lambda x=' ': list(map(int,input().split(x)))
RS=lambda x=' ': input().rstrip().split(x)
mod=int(1e9+7)
eps=1e-6
#################################################
n,m=RI()
x,y=0,0
print(min(n,m)+1)
if n<m:
    for i in range(n+1):
        print(i, n-i)
else:
    for i in range(m+1):
        print(i,m-i)







import math
import random

(n, m) = map(int, input().split())
n_points = n+1 if n < m else m+1
print(n_points)
for a in range(n_points)[::-1]:
	if n > m:
		print(n_points-1-a, a)
	else:
		print(a, n_points-1-a)

n, m = list(map(int, input().split()))

s = min(n, m)
print(s + 1)
for x in range(s + 1):
    if n < m:
        print(x, m - x)
    else:
        print(n - x, x)


import math
n, m = list(map(int, input().split()))
print(min(n, m) + 1)
for x in range(min(n, m) + 1):
		print(x, m - x)

'''
def main():
	from sys import stdin,stdout
def __starting_point():
	main()
'''
#Journey to moon
'''
def main():
	from sys import stdin,stdout
	import collections
	N,I =map(int,stdin.readline().split())
	visited=list(0 for x in range(N))
	G=collections.defaultdict(list)
	groups=[0]
	for _ in range(I):
		a,b=map(int,stdin.readline().split())
		G[a].append(b)
		G[b].append(a)
	q=collections.deque()
	flag=0
	for i in range(N):
		if not visited[i]:
			q.append(i)
			visited[i]=flag+1
			groups[flag]+=1
			while len(q):
				top=q.popleft()
				for j in G[top]:
					if visited[j]!=visited[top]:
						visited[j]=flag+1
						groups[flag]+=1
						q.append(j)
			flag+=1
			groups.append(0)
	counter=0
	for i in range(len(groups)-1):
		for j in range(i+1,len(groups)):
			counter+=groups[i]*groups[j]
	stdout.write(str(counter))
def __starting_point():
	main()
'''
#Djikstra's
'''
import collections
class Graph:
	def __init__(self):
		self.nodes=set()
		self.edges=collections.defaultdict(list)
		self.distances = {}

	def add_node(self, value):
		self.nodes.add(value)

	def add_edge(self, from_node, to_node, distance):
		self.edges[from_node].append(to_node)
		self.edges[to_node].append(from_node)
		self.distances[(from_node, to_node)] = distance
		self.distances[(to_node, from_node)] = distance


def dijsktra(graph, initial):
	visited = {initial: 0}
	path = {}

	nodes = set(graph.nodes)

	while nodes:
		min_node = None
		for node in nodes:
			if node in visited:
				if min_node is None:
					min_node = node
				elif visited[node] < visited[min_node]:
					min_node = node

		if min_node is None:
			break

		nodes.remove(min_node)
		current_weight = visited[min_node]

		for edge in graph.edges[min_node]:
			weight = current_weight + graph.distances[(min_node, edge)]
			if edge not in visited or weight < visited[edge]:
				visited[edge] = weight
				path[edge] = min_node

	return visited, path

def main():
	from sys import stdin,stdout
	for _ in range(int(stdin.readline())):
		n,m=map(int,stdin.readline().split())
		G=Graph()
		for i in range(n):
			G.add_node(i+1)
		for i in range(m):
			a,b,c=map(int,stdin.readline().split())
			G.add_edge(a,b,c)
		initial=int(stdin.readline())
		v,p=dijsktra(G, initial)
		#print(v)
		#print(p)
		for i in range(1,n+1):
			if i!=initial:
				k=v.get(i,-1)
				stdout.write(str(k)+' ')
		stdout.write('\n')
def __starting_point():
	main()
'''
#Larget pallindrome in String
'''
def main():
	from sys import stdin,stdout
	string=stdin.readline().strip()
	l=len(string)
	#Triangle logic	
	
	arrlen=(l*(l-1))//2
	arr=list(0 for x in range(arrlen))
	f=0
	c=l-1
	for i in range(l-1):
		for j in range(i+1,l):
			if string[i]==string[j]:
				arr[f+j-i-1]=1
		f+=c
		c-=1
	#print(arr)
	if any(arr):
		
	else:
		if l & 1:
			stdout.write('First')
		else:
			stdout.write('Second')
	#2-d Array Logic
	arr=list(list(0 for i in range(l)) for j in range(l))
	for i in range(l):
		for j in range(l):
			if string[i]==string[j]:
				arr[i][j]=1
	maxim=0
	for i in range(0,l*(l-1)-2,l+1):
		a,b=i+1,i+2
		#print(a,b)
		acount=0
		x=a//5
		y=a%5
		acount=arr[x][y]		
		x-=1
		y-=1
		while x>=0 and y>=0:
			acount+=arr[x][y]
			x-=1
			y-=1
		x=b//5
		y=b%5
		bcount=arr[x][y]		
		x-=1
		y-=1
		while x>=0 and y>=0:
			bcount+=arr[x][y]
			x-=1
			y-=1
		maxim=max((acount,bcount,maxim))
	maxim=max(maxim,arr[l-2][l-1])
	maxim=(maxim<<1)^1
	delta=l-maxim
	if delta & 1:
		stdout.write('Second')
	else:
		stdout.write('First')
def __starting_point():
	main()
'''
#276B
'''
def main():
	from sys import stdin,stdout
	import collections
	s=stdin.readline().strip()
	count=collections.Counter(s)
	l=list(filter(lambda x: count[x] & 1,list(x for x in count)))
	removed=sum(list(count[x] for x in l))-max(list(count[x] for x in l)+[0])
	if removed & 1:
		stdout.write('Second')
	else:
		stdout.write('First')
def __starting_point():
	main()
'''
#362B
'''
def main():
	from sys import stdin,stdout
	n,m=map(int,stdin.readline().split())
	if m:
		dirty=sorted(map(int,stdin.readline().split()))
		if dirty[0]==1 or dirty[-1]==n:
			stdout.write('NO')
		else:
			flag=True
			for i in range(m-2):
				if dirty[i+1]==dirty[i]+1 and dirty[i+2]==dirty[i]+2:
					flag=False
					break
			if flag:
				stdout.write('YES')
			else:
				stdout.write('NO')
	else:
		stdout.write('YES')
def __starting_point():
	main()
'''
#279B SUM OF SUB-ARRAY
'''
def main():
	from sys import stdin,stdout
	n,t=map(int,stdin.readline().split())
	arr=list(map(int,stdin.readline().split()))
	maxim=0
	curr_sum=arr[0]
	i=0
	j=1
	if curr_sum <=t:
		count=1
	else:
		curr_sum=0
		count=0
		i=1
		j=2
	while j<n:
		if curr_sum+arr[j]<=t:
			count+=1
			curr_sum+=arr[j]
			j+=1
		else:
			maxim=max(count,maxim)
			if curr_sum:
				curr_sum-=arr[i]
				count-=1
			else:
				j+=1
			i+=1
	maxim=max(count,maxim)
	stdout.write(str(maxim))
def __starting_point():
	main()
'''
#469B
'''
def main():
	from sys import stdin,stdout
	p,q,l,r=map(int,stdin.readline().split())
	a=[]
	b=[]
	visited=list(0 for x in range(r-l+1))
	#print(visited)	
	for i in range(p):
		x,y=map(int,stdin.readline().split())
		a.append(x)
		b.append(y)
	for i in range(q):
		x,y=map(int,stdin.readline().split())
		x+=l
		y+=l
		for j in range(p):
			#print('x=',x,'y=',y)
			lower=max(0,a[j]-y)
			upper=min(b[j]-x,r)+1
			if upper > lower:
				delta=upper-lower
				#print('upper=',upper,'lower=',lower)
				visited[lower:upper]=list(1 for x in range(delta))
				#print('visited:\n',visited)
	#	print(visited)
	stdout.write(str(visited[:r-l+1].count(1)))
def __starting_point():
	main()
'''
'''
def main():
	from sys import stdin,stdout
	#import numpy as np
	n,k=map(int,stdin.readline().split())
	a=tuple(map(int,stdin.readline().split()))
	minim=min(a)
	maxim=max(a)
	arr=list(a)	
	for i in range(n):
		arr[i]-=minim
	if max(arr) > k:
		stdout.write('NO')
	else:
		stdout.write('YES\n')
		for i in a:
			stdout.write('1 '*minim)
			for j in range(i-minim):
				stdout.write(str(j%k+1)+' ')
			stdout.write('\n')
def __starting_point():
	main()
'''
'''
def main():
	from sys import stdin,stdout
	n,p=[],[]
	for _ in range(int(stdin.readline())):
		last=int(stdin.readline())
		if last<0:
			n.append(-1*last)
		else:
			p.append(last)
	if sum(p)>sum(n):
		stdout.write('first')
	elif sum(n)>sum(p):
		stdout.write('second')
	else:
		maxim=max(n,p)
		#print(maxim)
		if maxim==p:
			if maxim==n:
				if last<0:
					stdout.write('second')
				else:
					stdout.write('first')
			else:
				stdout.write('first')
		else:
			stdout.write('second')
		
def __starting_point():
	main()
'''
#286C
def main():
	from sys import stdin,stdout
	m,n=list(map(int,stdin.readline().split()))
	minim=min(m,n)
	stdout.write(str(minim+1)+'\n')
	if n==minim:
		for i in range(minim+1):
			stdout.write(str(m)+' '+str(i)+'\n')
			m-=1
	else:
		for i in range(minim+1):
			stdout.write(str(i)+' '+str(n)+'\n')
			n-=1
def __starting_point():
	main()



__starting_point()

n, m = map(int, input().split())
x = min(n, m)
print(x+1)
for i in range (x+1):
    print(i, x - i)

n,m=map(int,input().split())
n=min(n,m)+1;print(n)
for i in range(0,n):print(i,n-i-1)

n,m=map(int,input().split())
x=[]
y=[]
cnt=0
for i in range(0,min(n,m)+1):
    cnt+=1
    x.append(i)
    y.append(min(n,m)-i)
print(cnt)
for i in range(cnt):
    print(x[i],y[i])