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 math


def solve():
  n, m = input().split()
  n = int(n)
  m = int(m)
  points = []

  for x in range(n + 1):
    for y in range(m + 1):
      if x + y <= 0:
        continue

      points.append((x, y))

  biggest_subset = []

  def find_biggest_subset(i, curr_subset):
    nonlocal points
    nonlocal biggest_subset

    if i == len(points):
      if len(curr_subset) > len(biggest_subset):
        biggest_subset = curr_subset
      return

    x, y = points[i]
    is_beautiful = True

    for x2, y2 in curr_subset:
      distance = get_distance(x2, y2, x, y)

      if int(distance) == distance:
        is_beautiful = False
        break

    if is_beautiful:
      curr_subset.append((x, y))

    find_biggest_subset(i + 1, curr_subset)

  for i in range(len(points)):
    find_biggest_subset(i, [])

  print(len(biggest_subset))
  
  for x, y in biggest_subset:
    print(x, y)


def get_distance(x2, y2, x1, y1):
  return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)


solve()
