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.util.*;
import java.io.*;
import java.math.BigInteger;
import static java.lang.Math.*;

public class Main implements Runnable {
	StringTokenizer tokenizer = new StringTokenizer("");
	BufferedReader in;
	PrintStream out;

	public void debug(String s) {
		System.out.println(s);
	}

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

	class Q implements Comparable <Q> {
		int a, b;

		Q(int a, int b) {
			this.a = a;
			this.b = b;
		}

		public int compareTo(Q r) {
			return Long.signum((long)a * r.b - (long)b * r.a);
		}
	}

	Q [] a, arev;

	int rev(int n) {
		int ret = 0;
		while (n > 0) {
			ret = (ret * 10) + n % 10;
			n /= 10;	
		}
		return ret;
	}

	final int N =  100005;

	TreeMap <Q, TreeSet<Integer>> map = new TreeMap <Q, TreeSet<Integer>>();

	int get(int xf, int y) {
		TreeSet <Integer> set =  map.get(arev[xf]);
		return set == null ? 0 : set.headSet(y + 1).size();	
	}

	public void run() {
		try {
			Locale.setDefault(Locale.US);
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintStream(System.out);

			
			long time = System.currentTimeMillis();

			a = new Q[N];
			arev = new Q[N];
			for (int i = 1; i < N; i++) a[i] = new Q(i, rev(i));
			for (int i = 1; i < N; i++) arev[i] = new Q(rev(i), i);

			for (int i = 1; i < N; i++) {
				TreeSet <Integer> hset = map.get(a[i]);
				if (hset == null) {
					TreeSet <Integer> set = new TreeSet <Integer> ();
					set.add(i);
					map.put(a[i], set);
				} else {
					hset.add(i);
				}
			}

			long ans = -1;
			int X = -1, Y = -1;

			int mX = nextInt(), mY = nextInt(), w = nextInt();

			int cX = mX, cY = mY;
			int have = 0;
			for (int i = 1; i <= cX; i++) have += get(i, cY);

			int g;
			while (have - (g = get(cY, cX)) >= w) {
				have -= g;
				cY--;
			}


			while (cX > 0) {
				if (have >= w) {
					if (ans == -1 || (long)cX * cY < ans) {
						ans = (long)cX * cY;
						X = cX;
						Y = cY;
					}
				}
				have -= get(cX, cY);
				cX--;
				while (have < w && cY < mY) {
					cY++;
					have += get(cY, cX);
				}
			}

			//System.out.println(System.currentTimeMillis() - time);

			out.println(ans == -1 ? ans : (X + " " + Y));


		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	boolean seekForToken() {
		while (!tokenizer.hasMoreTokens()) {
			String s = null;
			try {
				s = in.readLine();
			} catch (Exception e) {
				e.printStackTrace();
			}
			if (s == null)
				return false;
			tokenizer = new StringTokenizer(s);
		}
		return true;
	}

	String nextToken() {
		return seekForToken() ? tokenizer.nextToken() : null;
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	BigInteger nextBig() {
		return new BigInteger(nextToken());
	}
}