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 rev(int a) {
  int res = 0;
  while (a > 0) {
    res *= 10;
    res += a % 10;
    a /= 10;
  }
  return res;
}
pair<int, int> rev(pair<int, int> a) { return make_pair(a.second, a.first); }
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int A, B, W, M, co[100100], rco[100100], x[200100], y[200100];
pair<int, int> frac[100100];
pair<int, int> check(long long P) {
  memset(x, 0, sizeof(int) * M);
  memset(y, 0, sizeof(int) * M);
  int cur = min(P, (long long)B);
  for (int i = (1); i < (cur + 1); ++i) ++y[rco[i]];
  int lim = min(P, (long long)A);
  long long ile = 0;
  for (int i = (1); i < (lim + 1); ++i) {
    while ((long long)cur * i > P) {
      --y[rco[cur]];
      ile -= x[rco[cur]];
      --cur;
    }
    ++x[co[i]];
    ile += y[co[i]];
    if (ile >= W) return make_pair(i, cur);
  }
  return make_pair(-1, -1);
}
int main(void) {
  scanf("%d%d%d", &A, &B, &W);
  vector<pair<int, int> > all;
  for (int i = (1); i < (max(A, B) + 1); ++i) {
    int d = gcd(i, rev(i));
    frac[i] = make_pair(i / d, rev(i) / d);
    all.push_back(frac[i]);
    all.push_back(rev(frac[i]));
  }
  M = ((int)((all).size()));
  sort((all).begin(), (all).end());
  for (int i = (1); i < (max(A, B) + 1); ++i) {
    co[i] = lower_bound((all).begin(), (all).end(), frac[i]) - all.begin();
    rco[i] =
        lower_bound((all).begin(), (all).end(), rev(frac[i])) - all.begin();
  }
  long long l = 1, r = (long long)A * B, mid;
  pair<int, int> best = make_pair(-1, -1);
  while (l <= r) {
    mid = (l + r) / 2;
    pair<int, int> z = check(mid);
    if (z.first == -1)
      l = mid + 1;
    else {
      best = z;
      r = mid - 1;
    }
  }
  if (best.first == -1)
    puts("-1");
  else
    printf("%d %d\n", best.first, best.second);
  return 0;
}