#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7f7f7f7f;
const int MAXN = 1e6 + 111;
long long ansh = 0, answ = 0;
void solve1(long long a, long long b) {
  long long base = 1;
  while (base <= a) base *= 2;
  base /= 2;
  long long mx = base * 1.25, mi = ceil(base * 0.8);
  if (mx <= b && base * mx >= ansh * answ) {
    if (base * mx > ansh * answ) {
      ansh = base, answ = mx;
    } else if (base > ansh) {
      ansh = base, answ = mx;
    }
  } else if (mi <= b && base * b >= ansh * answ) {
    if (base * b > ansh * answ) {
      ansh = base, answ = b;
    } else if (base > ansh) {
      ansh = base, answ = b;
    }
  } else if (mi > b) {
    solve1(base / 2, b);
  }
}
void solve2(long long a, long long b) {
  long long base = 1;
  while (base < a) base *= 2;
  base /= 2;
  long long mx = base * 1.25, mi = ceil(base * 0.8);
  if (mx <= b && base * mx >= ansh * answ) {
    if (base * mx > ansh * answ) {
      ansh = mx, answ = base;
    } else if (mx > ansh) {
      ansh = mx, answ = base;
    }
  } else if (mi <= b && base * b >= ansh * answ) {
    if (base * b > ansh * answ) {
      ansh = b, answ = base;
    } else if (b > ansh) {
      ansh = b, answ = base;
    }
  } else if (mi > b) {
    solve2(base / 2, b);
  }
}
int main() {
  long long h, w;
  while (cin >> h >> w) {
    solve1(h, w);
    solve2(w, h);
    cout << ansh << ' ' << answ << '\n';
  }
  return 0;
}
