Problem: 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. 
  2. 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 <image>, between (0, 1) and (2, 0) — <image>, between (1, 2) and (2, 0) — <image>. 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.

Solution (in JAVA):

Solution:
import org.omg.PortableServer.POA;

import java.awt.*;
import java.awt.peer.CanvasPeer;
import java.io.*;
import java.util.*;

public class Main {
    static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    final static long INF = Long.MAX_VALUE;
    private final static Random rnd = new Random();

    boolean checkIndex(int index, int size) {
        return (0 <= index && index < size);
    }

    class Point implements Comparable<Point> {
        int p;
        int k;

        void Point(int p, int k) {
            this.k = k;
            this.p = p;
        }

        @Override
        public int compareTo(Point o) {
            if (this.k > o.k) {
                return 1;
            } else {
                if (this.k < o.k) {
                    return -1;
                } else return (this.p > o.p ? -1 : 1);
            }
        }
    }

    void solve() throws IOException {
        int n = rI();
        int m = rI();
        out.println(minInt(n, m) + 1);
        int[][] answer = new int[n + 1][m + 1];
        for (int i = n; i >= 0; i--) {
            for (int j = 0; j <= m; j++) {
                out.println(i + " " + j);
                i--;
                if (i==-1){
                    return;
                }
            }
            break;
        }

    }


    // ===========================================================================
    long minLong(long... values) {
        long min = Integer.MAX_VALUE;
        for (long value : values) {
            min = Math.min(min, value);
        }
        return min;
    }

    long maxLong(long... values) {
        long max = Integer.MIN_VALUE;
        for (long value : values) {
            max = Math.max(max, value);
        }
        return max;
    }

    int maxInt(int... values) {
        int max = Integer.MIN_VALUE;
        for (int value : values) {
            max = Math.max(max, value);
        }
        return max;
    }

    int minInt(int... values) {
        int min = Integer.MAX_VALUE;
        for (int value : values) {
            min = Math.min(min, value);
        }
        return min;
    }

    // ==============================================================================

    public static void main(String[] args) {
        new Main().run();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    long maxA(int[] ans) {
        long max = Integer.MIN_VALUE;
        for (int i = 0; i < ans.length; i++) {
            if (ans[i] > max) {
                max = ans[i];

            }
        }
        return max;
    }

    long minA(long[] a) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < a.length; i++) {
            if (a[i] < min) {
                min = a[i];
            }
        }
        return min;
    }

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
        tok = new

                StringTokenizer("");

    }

    void run() {
        try {
            long timeStart = System.currentTimeMillis();

            init();
            solve();

            out.close();

            long timeEnd = System.currentTimeMillis();
            System.err.println("Time = " + (timeEnd - timeStart) + " COMPILED");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((-memoryTotal + memoryFree) >> 10) + " KB");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String delimiter = " ";

    String rS() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine)
                return null;

            tok = new StringTokenizer(nextLine);
        }

        return tok.nextToken(delimiter);
    }

    int[] rA(int b) {
        int a[] = new int[b];
        for (int i = 0; i < b; i++) {
            try {
                a[i] = rI();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return a;
    }

    int rI() throws IOException {
        return Integer.parseInt(rS());
    }

    long rL() throws IOException {
        return Long.parseLong(rS());
    }

    void sort(int[] a) {
        Integer arr[] = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
    }

}