This morning Tolik has understood that while he was sleeping he had invented an incredible problem which will be a perfect fit for Codeforces! But, as a "Discuss tasks" project hasn't been born yet (in English, well), he decides to test a problem and asks his uncle.

After a long time thinking, Tolik's uncle hasn't any ideas on how to solve it. But, he doesn't want to tell Tolik about his inability to solve it, so he hasn't found anything better than asking you how to solve this task.

In this task you are given a cell field n ⋅ m, consisting of n rows and m columns, where point's coordinates (x, y) mean it is situated in the x-th row and y-th column, considering numeration from one (1 ≤ x ≤ n, 1 ≤ y ≤ m). Initially, you stand in the cell (1, 1). Every move you can jump from cell (x, y), which you stand in, by any non-zero vector (dx, dy), thus you will stand in the (x+dx, y+dy) cell. Obviously, you can't leave the field, but also there is one more important condition — you're not allowed to use one vector twice. Your task is to visit each cell of the field exactly once (the initial cell is considered as already visited).

Tolik's uncle is a very respectful person. Help him to solve this task!

Input

The first and only line contains two positive integers n, m (1 ≤ n ⋅ m ≤ 10^{6}) — the number of rows and columns of the field respectively.

Output

Print "-1" (without quotes) if it is impossible to visit every cell exactly once.

Else print n ⋅ m pairs of integers, i-th from them should contain two integers x_i, y_i (1 ≤ x_i ≤ n, 1 ≤ y_i ≤ m) — cells of the field in order of visiting, so that all of them are distinct and vectors of jumps between them are distinct too.

Notice that the first cell should have (1, 1) coordinates, according to the statement.

Examples

Input


2 3


Output


1 1
1 3
1 2
2 2
2 3
2 1

Input


1 1


Output


1 1

Note

The vectors from the first example in the order of making jumps are (0, 2), (0, -1), (1, 0), (0, 1), (0, -2).
import java.util.*;
import java.math.*;

// **** D. Tolik and His Uncle ****

public class D {
	static char [] in = new char [1000000];
	public static void main (String [] arg) throws Throwable {
		int n = nextInt();
		int m = nextInt();
		Pair [] ans = new Pair[n*m];
		int ptr = 0;
		for (int i = 0; i<n && ptr < ans.length; ++i) {
			int dcol = (i %2 == 0) ? 1 : -1;
			int start = (i%2 == 0) ? 0 : m-1;
			//if (i != 0) ans[ptr++] = new Pair(i, start, 0); 
			
			for (int j = start; j >= 0 && j < m && ptr < ans.length; j += dcol) {
				ans[ptr++] = new Pair(i, j,0);
				if (ptr == ans.length) break;
				ans[ptr++] = new Pair(n-i-1, m-j-1,0);
			}
		}
		// safety check
		/*
		long MOD = 1000000007;
		HashSet<Long> fail = new HashSet<Long>(n*m);
		for (int i = 0; i<ans.length; ++i) {
			//System.err.println(i + " : " + ans[i].x + " , " + ans[i].y);
			long tmp = ans[i].x + MOD * ans[i].y;
			if (fail.contains(tmp)) System.err.println("Fuck");
			fail.add(tmp);
		}
		HashSet<Long> fail2 = new HashSet<Long>(n*m);
		for (int i = 1; i<ans.length; ++i) {
			long tmp = ans[i].x + MOD * ans[i].y - ans[i-1].x - MOD * ans[i-1].y;
			if (fail2.contains(tmp)) System.err.println("Fuck Difference");
			fail2.add(tmp);
		}
		*/
		System.out.print(stringFromArray(ans));
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	/************** HELPER CLASSES ***************/
    //static class HS extends HashSet<Integer>{public HS(){super();}public HS(int a){super(a);}};
	//static class AL extends ArrayList<Integer>{public AL(){super();}public AL(int a){super (a);}};
static class Pair implements Comparable<Pair> {int x,y;long L; public Pair(int xx, int yy, long LL){x=xx;y=yy;L=LL;} public int compareTo(Pair p) {
		return (this.L < p.L) ? -1 : ((this.L == p.L && this.x < p.y) ? -1 : 1);}
	}
	
	/************** FAST IO CODE FOLLOWS *****************/
	public static long nextLong() throws Throwable {
		long i = System.in.read();boolean neg = false;while (i < 33) i = System.in.read();if (i == 45) {neg=true;i=48;}i = i - 48;
		int j = System.in.read();while (j > 32) {i*=10;i+=j-48;j = System.in.read();}return (neg) ? -i : i;
	}
	public static int nextInt() throws Throwable {return (int)nextLong();}
	public static String next() throws Throwable {
		int i = 0; while (i < 33 && i != -1) i = System.in.read(); int cptr = 0; while (i >= 33) { in[cptr++] = (char)i; i = System.in.read();}
		return new String(in, 0,cptr);
	}
	/**** LIBRARIES ****/
	public static long gcdL(long a, long b) {while (b != 0) {long tmp = b;b = (a % b);a = tmp;}return a;}
	public static int gcd(int a, int b) {while (b != 0) {int tmp = b;b = (a % b);a = tmp;}return a;}
	public static int[] sieve(int LIM) {
		int i,count = 0;
		boolean [] b = new boolean [LIM];
		for (i = 2;i<LIM; ++i) if (!b[i]) {count++; for (int j = i<<1; j<LIM; j+=i) b[j] = true;}
		int [] primes = new int[count];
		for (i = 2,count=0;i<LIM;++i) if (!b[i]) primes[count++] = i;
		return primes;
	}
	public static int[] numPrimeFactors(int LIM) {
		int i,count = 0;
		int [] b = new int [LIM];
		for (i = 2;i<LIM; ++i) if (b[i] == 0) {count++; for (int j = i; j<LIM; j+=i) b[j]++;}
		return b;
	}
	public static StringBuilder stringFromArray(Pair [] a) {
		StringBuilder b = new StringBuilder(9*a.length);
		for (int i = 0; i<a.length; ++i) {
			if (i != 0) b = b.append("\n");
			b = b.append(1+a[i].x);
			b = b.append(' ');
			b = b.append(1+a[i].y);
		}
		return b;
	}
}

/* Full Problem Text:
  
This morning Tolik has understood that while he was sleeping he had invented an incredible problem which will be a perfect fit for Codeforces! But, as a "Discuss tasks" project hasn't been born yet (in English, well),
he decides to test a problem and asks his uncle.
After a long time thinking, Tolik's uncle hasn't any ideas on how to solve it.
But, he doesn't want to tell Tolik about his inability to solve it, so he hasn't found anything better than asking you how to solve this task.
In this task you are given a cell field n \cdot m, consisting of n rows and m columns, where point's coordinates (x, y) mean it is situated in the x-th row and y-th column, considering numeration from one (1 <q x <q n, 1 <q y <q m).
Initially, you stand in the cell (1, 1).
Every move you can jump from cell (x, y),
which you stand in, by any non-zero vector (dx, dy),
thus you will stand in the (x+dx, y+dy) cell.
Obviously, you can't leave the field, but also there is one more important condition you're not allowed to use one vector twice.
Your task is to visit each cell of the field exactly once (the initial cell is considered as already visited).
Tolik's uncle is a very respectful person.
Help him to solve this task!

 */