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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Lucky implements Runnable {
    static class Fraction {
        int p;
        int q;

        Fraction(int p, int q) {
            int g = gcd(p, q);
            this.p = p / g;
            this.q = q / g;
        }

        private int gcd(int p, int q) {
            while (q > 0) {
                int t = p % q;
                p = q;
                q = t;
            }
            return p;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Fraction fraction = (Fraction) o;

            if (p != fraction.p) return false;
            if (q != fraction.q) return false;

            return true;
        }

        @Override
        public int hashCode() {
            int result = p;
            result = 31 * result + q;
            return result;
        }
    }

    private void solve() throws IOException {
        int maxX = nextInt();
        int maxY = nextInt();
        long W = nextInt();
        long res = Long.MAX_VALUE / 2;
        int resX = -1;
        int resY = -1;
        Fraction[] xf = new Fraction[maxX + 1];
        for (int x = 1; x <= maxX; ++x) {
            xf[x] = new Fraction(x, rev(x));
        }
        Fraction[] yf = new Fraction[maxY + 1];
        for (int y = 1; y <= maxY; ++y) {
            yf[y] = new Fraction(rev(y), y);
        }
        HashMap<Fraction, Integer> xCount = new HashMap<Fraction, Integer>();
        HashMap<Fraction, Integer> yCount = new HashMap<Fraction, Integer>();
        for (int x = 1; x <= maxX; ++x) {
            Fraction f = xf[x];
            if (xCount.containsKey(f))
                xCount.put(f, xCount.get(f) + 1);
            else
                xCount.put(f, 1);
        }

        int y = 0;
        long curW = 0;
        for (int x = maxX; x >= 1; --x) {
            while (curW < W && y < maxY) {
                ++y;
                Fraction f = yf[y];
                if (yCount.containsKey(f))
                    yCount.put(f, yCount.get(f) + 1);
                else
                    yCount.put(f, 1);
                if (xCount.containsKey(f))
                    curW += xCount.get(f);
            }
            if (curW < W) break;
            if (x * (long) y < res) {
                res = x * (long) y;
                resX = x;
                resY = y;
            }
            {
                Fraction f = xf[x];
                if (yCount.containsKey(f))
                    curW -= yCount.get(f);
                xCount.put(f, xCount.get(f) - 1);
            }
        }
        writer.print(resX);
        if (resX >= 0) {
            writer.println(" " + resY);
        } else {
            writer.println();
        }
    }

    private int rev(int x) {
        int p10 = 1;
        while (p10 <= x)
            p10 *= 10;
        int y = 0;
        while (x > 0) {
            p10 /= 10;
            y += p10 * (x % 10);
            x /= 10;
        }
        return y;
    }

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    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 nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}