#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int maxn = 100010;
const int mod = 1000000007;
long long p[64];
int main() {
  ios::sync_with_stdio(false);
  p[0] = 1;
  for (int i = 1; i <= 30; i++) {
    p[i] = p[i - 1] * 2;
  }
  long long a, b, x, y;
  long long s = 0;
  cin >> a >> b;
  for (int i = 0; i <= 30; i++) {
    if (p[i] <= a) {
      if (p[i] * 5 <= 4 * b) {
        if (s < p[i] * p[i] * 5 / 4) {
          s = p[i] * p[i] * 5 / 4;
          x = p[i];
          y = p[i] * 5 / 4;
        }
      } else if (p[i] * 4 <= 5 * b) {
        if (s < p[i] * b) {
          s = p[i] * b;
          x = p[i];
          y = b;
        }
      }
    }
  }
  for (int i = 0; i <= 30; i++) {
    if (p[i] <= b) {
      if (a * 4 >= 5 * p[i]) {
        if (s < p[i] * p[i] * 5 / 4 ||
            s == p[i] * p[i] * 5 / 4 && x < p[i] * 5 / 4) {
          s = p[i] * p[i] * 5 / 4;
          x = p[i] * 5 / 4;
          y = p[i];
        }
      } else if (a * 5 >= 4 * b) {
        if (s < p[i] * a) {
          s = p[i] * a;
          x = a;
          y = p[i];
        }
      }
    }
  }
  cout << x << " " << y << "\n";
  return 0;
}
