Problem: In Walrusland public transport tickets are characterized by two integers: by the number of the series and by the number of the ticket in the series. Let the series number be represented by a and the ticket number — by b, then a ticket is described by the ordered pair of numbers (a, b). 

The walruses believe that a ticket is lucky if a * b = rev(a) * rev(b). The function rev(x) reverses a number written in the decimal system, at that the leading zeroes disappear. For example, rev(12343) = 34321, rev(1200) = 21.

The Public Transport Management Committee wants to release x series, each containing y tickets, so that at least w lucky tickets were released and the total number of released tickets (x * y) were minimum. The series are numbered from 1 to x inclusive. The tickets in each series are numbered from 1 to y inclusive. The Transport Committee cannot release more than maxx series and more than maxy tickets in one series.

Input

The first line contains three integers maxx, maxy, w (1 ≤ maxx, maxy ≤ 105, 1 ≤ w ≤ 107).

Output

Print on a single line two space-separated numbers, the x and the y. If there are several possible variants, print any of them. If such x and y do not exist, print a single number  - 1.

Examples

Input

2 2 1


Output

1 1

Input

132 10 35


Output

7 5

Input

5 18 1000


Output

-1


Input

48 132 235


Output

22 111

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) throws IOException {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					try {
						if (new File("input.txt").exists())
							System.setIn(new FileInputStream("input.txt"));
					} catch (SecurityException e) {}
					new Main().run();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "1", 1L << 24).start(); 
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	int MX;
	int MY;
	int W;
	
	Q[] qx;
	Q[] qy;
	
	Map<Q, Integer> mapX = new TreeMap<Q, Integer>();
	Map<Q, Integer> mapY = new TreeMap<Q, Integer>();
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		MX = nextInt();
		MY = nextInt();
		W = nextInt();
		
		qx = new Q [MX];
		qy = new Q [MY];

		for (int x = 1; x <= MX; x++)
			qx[x - 1] = new Q(x - 1, x, rev(x));
		for (int y = 1; y <= MY; y++)
			qy[y - 1] = new Q(y - 1, rev(y), y);
		
		for (Q q : qx)
			add(mapX, q);
		
		int bx = MX;
		int y;
		long by = 0;
		
		int cur = 0;
		for (y = 0; y < MY && cur < W; y++) {
			add(mapY, qy[y]);
			cur += get(mapX, qy[y]);
			by = y + 1;
		}
		
		if (cur < W) {
			out.println(-1);
			out.close();
			return;
		}
		
		long best = bx * by;
		
//		System.out.println(bx + " " + by + " " + best + " " + cur);
		
		for (int x = MX - 1; x > 0; x--) {
			cur -= get(mapY, qx[x]);
			rem(mapX, qx[x]);
			for (; y < MY && cur < W; y++) {
				add(mapY, qy[y]);
				cur += get(mapX, qy[y]);
			}
			if (cur < W)
				break;
			int cx = x;
			long cy = y;
			long ca = cx * cy;
			if (best > ca) {
				best = ca;
				bx = cx;
				by = cy;
			}
		}
		
		out.println(bx + " " + by);
		
		out.close();
	}

	void add(Map<Q, Integer> map, Q q) {
		if (!map.containsKey(q)) {
			map.put(q, 1);
		} else {
			map.put(q, map.get(q) + 1);
		}
	}
	
	void rem(Map<Q, Integer> map, Q q) {
		if (map.containsKey(q)) {
			int v = map.get(q);
			if (v == 1)
				map.remove(q);
			else
				map.put(q, v - 1);
		}
	}
	
	int get(Map<Q, Integer> map, Q q) {
		return map.containsKey(q) ? map.get(q) : 0;
	}

	int rev(int x) {
		return Integer.parseInt(new StringBuffer(x + "").reverse().toString());
	}
	
	long gcd(long a, long b) {
		while (a > 0L && b > 0L)
			if (a > b)
				a %= b;
			else
				b %= a;
		return a + b;
	}
	
	class Q implements Comparable<Q> {
		int id;
		long num;
		long den;
		
		Q(int id, long num, long den) {
			this.id = id;
			long gcd = gcd(num, den);
			this.num = num / gcd;
			this.den = den / gcd;
		}

		@Override
		public int compareTo(Q q) {
			long m1n = num * q.den;
			long m2n = q.num * den;
			if (m1n != m2n)
				return  m1n < m2n ? -1 : 1;
//			return id - q.id;
			return 0;
		}
	}
	
	/*************************************************************** 
	 * Input 
	 **************************************************************/
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}