Max and Min

Two kittens, Max and Min, play with a pair of non-negative integers x and y. As you can guess from their names, kitten Max loves to maximize and kitten Min loves to minimize. As part of this game Min wants to make sure that both numbers, x and y became negative at the same time, and kitten Max tries to prevent him from doing so.

Each kitten has a set of pairs of integers available to it. Kitten Max has n pairs of non-negative integers (a i, b i) (1 ≤ i ≤ n), and kitten Min has m pairs of non-negative integers (c j, d j) (1 ≤ j ≤ m). As kitten Max makes a move, it can take any available pair (a i, b i) and add a i to x and b i to y, and kitten Min can take any available pair (c j, d j) and subtract c j from x and d j from y. Each kitten can use each pair multiple times during distinct moves.

Max moves first. Kitten Min is winning if at some moment both numbers ab are negative simultaneously. Otherwise, the winner of the game is kitten Max. Determine which kitten wins if both of them play optimally.

Input

The first line contains two integers, n and m (1 ≤ n, m ≤ 100 000) — the number of pairs of numbers available to Max and Min, correspondingly.

The second line contains two integers xy (1 ≤ x, y ≤ 109) — the initial values of numbers with which the kittens are playing.

Next n lines contain the pairs of numbers a i, b i (1 ≤ a i, b i ≤ 109) — the pairs available to Max.

The last m lines contain pairs of numbers c j, d j (1 ≤ c j, d j ≤ 109) — the pairs available to Min.

Output

Print «Max» (without the quotes), if kitten Max wins, or “Min” (without the quotes), if kitten Min wins.

Examples

input

2 2
42 43
2 3
3 2
3 10
10 3

output

Min

input

1 1
1 1
3 4
1 1

output

Max

Note

In the first test from the statement Min can respond to move (2, 3) by move (3, 10), and to move (3, 2) by move (10, 3). Thus, for each pair of Max and Min’s moves the values of both numbers x and y will strictly decrease, ergo, Min will win sooner or later.

In the second sample test after each pair of Max and Min’s moves both numbers x and y only increase, thus none of them will become negative.

Solution:

import java.io.*;
import java.util.*;

public class E {

static void solve() throws IOException {
int m = in.nextInt();
int n = in.nextInt();
in.nextInt();
in.nextInt();
Point[] q = new Point[m];
for (int i = 0; i < m; i++) {
			q[i] = new Point(in.nextInt(), in.nextInt(), 1);
		}
		Point[] p = new Point[n + 3];
		long maxY = 0;
		long maxX = 0;
		for (int i = 0; i < n; i++) {
			p[i] = new Point(in.nextInt(), in.nextInt(), 0);
			maxY = Math.max(maxY, p[i].y);
			maxX = Math.max(maxX, p[i].x);
		}
		p[n] = new Point(0, 0, 2);
		p[n + 1] = new Point(0, maxY, 2);
		p[n + 2] = new Point(maxX, 0, 2);
		Point[] z = convexHull(p);
		for (Point e : q) {
			int l = 1;
			int r = z.length - 1;
			while (l < r - 1) {
				int mid = (l + r) >> 1;
if ((long) z[mid].x * e.y - (long) e.x * z[mid].y >= 0) {
l = mid;
} else {
r = mid;
}
}
long la = z[l + 1].y - z[l].y;
long lb = z[l].x - z[l + 1].x;
long lc = -z[l].x * la - z[l].y * lb;
if (la * e.x + lb * e.y + lc >= 0) {
out.println("Max");
return;
}
}
out.println("Min");
}

static Point[] convexHull(Point[] p) {
p = p.clone();
for (int i = 0; i < p.length; i++) {
			if (p[i].x < p[0].x || p[i].x == p[0].x && p[i].y < p[0].y) {
				Point t = p[i];
				p[i] = p[0];
				p[0] = t;
			}
		}
		final Point first = p[0];
		Arrays.sort(p, 1, p.length, new Comparator<Point>() {
@Override
public int compare(Point o1, Point o2) {
long x1 = o1.x - first.x;
long y1 = o1.y - first.y;
long x2 = o2.x - first.x;
long y2 = o2.y - first.y;
int c = Long.signum(x1 * y2 - x2 * y1);
if (c != 0)
return -c;
return Long.signum(x1 * x1 + y1 * y1 - x2 * x2 - y2 * y2);
}
});
int sz = 2;
for (int i = 2; i < p.length; i++) {
			while (sz > 1 && vmulFromPoint(p[sz - 2], p[sz - 1], p[i]) <= 0) {
				--sz;
			}
			p[sz++] = p[i];
		}
		return Arrays.copyOf(p, sz);
	}

	static long vmulFromPoint(Point first, Point o1, Point o2) {
		long x1 = o1.x - first.x;
		long y1 = o1.y - first.y;
		long x2 = o2.x - first.x;
		long y2 = o2.y - first.y;
		return x1 * y2 - x2 * y1;
	}

	static class Point {
		long x;
		long y;
		int type;

		public Point(long x, long y, int type) {
			this.x = x;
			this.y = y;
			this.type = type;
		}

	}

	static InputReader in;
	static PrintWriter out;

	public static void main(String[] args) throws IOException {
		in = new InputReader(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	static class InputReader {
		BufferedReader br;

		public InputReader(InputStream stream) {
			br = new BufferedReader(new InputStreamReader(stream));
		}

		public int nextInt() throws IOException {
			int c = br.read();
			while (c <= 32) {
				c = br.read();
			}
			boolean negative = false;
			if (c == '-') {
				negative = true;
				c = br.read();
			}
			int x = 0;
			while (c > 32) {
x = x * 10 + c - '0';
c = br.read();
}
return negative ? -x : x;
}

public long nextLong() throws IOException {
int c = br.read();
while (c <= 32) {
				c = br.read();
			}
			boolean negative = false;
			if (c == '-') {
				negative = true;
				c = br.read();
			}
			long x = 0;
			while (c > 32) {
x = x * 10 + c - '0';
c = br.read();
}
return negative ? -x : x;
}

public String next() throws IOException {
int c = br.read();
while (c <= 32) {
				c = br.read();
			}
			StringBuilder sb = new StringBuilder();
			while (c > 32) {
sb.append((char) c);
c = br.read();
}
return sb.toString();
}

public double nextDouble() throws IOException {
return Double.parseDouble(next());
}
}
}