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 CPP):

Solution:
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000000")
using namespace std;
const long long int INF = 2e15;
int rev(int a) {
  vector<int> temp;
  while (a) {
    temp.push_back(a % 10);
    a /= 10;
  }
  int sz = (int)temp.size();
  for (int i = (int)temp.size() - 1; i >= 0; i--) {
    if (temp[i] == '0')
      sz = i;
    else
      break;
  }
  temp.resize(sz);
  reverse(temp.begin(), temp.end());
  int last = 1;
  int out = 0;
  for (int i = 0; i < ((int)temp.size()); i++) {
    out += temp[i] * last;
    last *= 10;
  }
  return out;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
map<pair<int, int>, vector<int> > cnt;
void pre(int to) {
  for (int i = 1; i <= to; i++) {
    int f = rev(i);
    int s = i;
    int gc = gcd(f, s);
    f /= gc;
    s /= gc;
    cnt[make_pair(f, s)].push_back(i);
  }
}
long long int fen[1000000];
void inc(int id, int n) {
  for (; id <= n; id += ((id + 1) & -(id + 1))) {
    fen[id]++;
  }
}
long long int geti(int id) {
  long long int out = 0;
  for (; id >= 0; id -= ((id + 1) & -(id + 1))) {
    out += fen[id];
  }
  return out;
}
void upd(long long int &r1, int &outx, int &outy, int w, int w2) {
  long long int r2 = (long long int)w * 1LL * (long long int)w2;
  if (r2 < r1) {
    r1 = r2;
    outx = w;
    outy = w2;
  }
}
int main() {
  int mx, my, w;
  cin >> mx >> my >> w;
  pre(my);
  memset(fen, 0, sizeof fen);
  int outx = -1, outy = -1;
  long long int r1 = INF;
  for (int i = 1; i <= mx; i++) {
    int f = i;
    int s = rev(f);
    int gc = gcd(f, s);
    f /= gc;
    s /= gc;
    map<pair<int, int>, vector<int> >::iterator it = cnt.find(make_pair(f, s));
    if (it == cnt.end()) continue;
    int last = 1;
    long long int val;
    for (int j = 0; j < ((int)it->second.size()); j++) {
      int to = it->second[j];
      val = geti(to - 1);
      if (val >= w && last <= to - 1) {
        int l = last, r = to - 1;
        while (l != r) {
          int mid = (l + r) / 2;
          val = geti(mid);
          if (val < w)
            l = mid + 1;
          else
            r = mid;
        }
        upd(r1, outx, outy, i, l);
      }
      last = to;
      inc(to, my);
      val = geti(to);
      if (val >= w) {
        upd(r1, outx, outy, i, to);
      }
    }
    val = geti(my);
    if (val >= w) {
      int l = last, r = my;
      while (l != r) {
        int mid = (l + r) / 2;
        val = geti(mid);
        if (val < w)
          l = mid + 1;
        else
          r = mid;
      }
      upd(r1, outx, outy, i, l);
    }
  }
  if (outx == -1) {
    cout << -1;
  } else {
    cout << outx << " " << outy;
  }
}