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>
using namespace std;
int num[120];
int Rev(int x) {
  int t = 0;
  while (x > 0) {
    num[t++] = x % 10;
    x /= 10;
  }
  int sum = 0;
  for (int i = 0; i < t; i++) {
    sum *= 10;
    sum += num[i];
  }
  return sum;
}
struct Np {
  int x, y;
} q[1500000];
bool cmp(const Np &x, const Np &y) {
  if (x.y == y.y) return x.x > y.x;
  return x.y < y.y;
}
struct D {
  int x, y;
  double va;
} d[150000];
const double eps = 1e-13;
double Ab(double x) {
  if (x < 0.0) return -x;
  return x;
}
bool Eq(double x, double y) {
  if (Ab(x - y) < eps) return true;
  return false;
}
bool cmp2(const D &x, const D &y) {
  if (Eq(x.va, y.va)) return x.x > y.x;
  return x.va < y.va;
}
int Cal(int x, int y) {
  int t = 0;
  int gs = max(x, y);
  int i;
  for (i = 1; i <= gs; i++) {
    d[i - 1].x = i;
    d[i - 1].y = Rev(i);
    d[i - 1].va = (double)i / (double)Rev(i);
  }
  sort(d, d + gs, cmp2);
  for (i = 0; i < gs; i++) {
    if (d[i].x > x) continue;
    int nx, ny;
    int tx, ty;
    nx = d[i].x;
    ny = d[i].y;
    int lo, up, mid;
    lo = 0;
    up = gs;
    while (lo + 1 < up) {
      mid = (lo + up) / 2;
      if (d[i].va * d[mid].va > 1.0 + eps)
        up = mid;
      else
        lo = mid;
    }
    for (int j = lo; j >= 0; j--) {
      tx = d[j].x;
      ty = d[j].y;
      if (tx > y || d[i].va * d[j].va > 1.0 + eps)
        break;
      else {
        if ((long long)tx * (long long)nx == (long long)ny * (long long)ty) {
          q[t].x = nx;
          q[t].y = tx;
          t++;
        } else
          break;
      }
    }
  }
  sort(q, q + t, cmp);
  return t;
}
int tree[150000];
int N;
void init() {
  for (int i = 1; i <= N; i++) tree[i] = 0;
}
int read(int k) {
  int sum = 0;
  while (k) {
    sum += tree[k];
    k -= k & -k;
  }
  return sum;
}
void update(int k, int v) {
  while (k <= N) {
    tree[k] += v;
    k += k & -k;
  }
}
int n, m, w, i, x, y, po;
int main() {
  while (~scanf("%d%d%d", &n, &m, &w)) {
    int num = Cal(n, m);
    N = n;
    init();
    po = n;
    x = n + 1;
    y = m + 1;
    for (i = 0; i < num; i++) {
      update(q[i].x, 1);
      while (po >= 1 && read(po) >= w) {
        if ((long long)x * (long long)y > (long long)q[i].y * (long long)po) {
          x = po;
          y = q[i].y;
        }
        po--;
      }
    }
    if (x == n + 1 && y == m + 1)
      puts("-1");
    else
      printf("%d %d\n", x, y);
  }
}