#include <bits/stdc++.h>
using namespace std;
struct item {
  int x, y;
  long long s;
  item() {}
  item(int _x, int _y) {
    x = _x;
    y = _y;
    s = (long long)x * y;
  }
  bool operator<(const item &a) {
    if (s != a.s) return s < a.s;
    return y < a.y;
  }
};
int main() {
  int a, b;
  cin >> a >> b;
  double eps = 1e-7;
  double y = -1;
  double x;
  double z, zz;
  item ans(0, 0), t;
  double ko;
  double dx[] = {0.8, 1.25, 1};
  while (y <= a) {
    if (y == -1)
      y = 1;
    else
      y *= 2;
    x = y / 0.8;
    if (x > b + eps) x = b;
    if (y > a + eps) continue;
    x = floor(x);
    ko = y / x;
    if (ko > 1.25 + eps || ko < 0.8 - eps) continue;
    t = item(x, y);
    if (ans < t) ans = t;
  }
  x = -1;
  while (x <= b) {
    if (x == -1)
      x = 1;
    else
      x *= 2;
    y = x * 1.25;
    if (y > a + eps) y = a;
    if (x > b + eps) continue;
    x = floor(x);
    ko = y / x;
    if (ko > 1.25 + eps || ko < 0.8 - eps) continue;
    if (y > a + eps || y < 0) continue;
    t = item(x, y);
    if (ans < t) ans = t;
  }
  cout << ans.y << " " << ans.x;
  return 0;
}
