#include <bits/stdc++.h>
using namespace std;
long long hm = 0, wm = 0;
void compare(long long h, long long w) {
  if ((h * w > hm * wm) || (h * w == hm * wm && h > hm)) {
    hm = h;
    wm = w;
  }
  return;
}
void func(long long h, long long w, bool b) {
  long long hnew = 1;
  while (hnew <= h) {
    double r = w * 1.0 / hnew;
    if (r >= 1.25) {
      if (b)
        compare(hnew, hnew * 1.25);
      else
        compare(hnew * 1.25, hnew);
    } else if (r >= 0.8) {
      if (b)
        compare(hnew, w);
      else
        compare(w, hnew);
    }
    hnew *= 2;
  }
}
int main() {
  long long h, w;
  cin >> h >> w;
  func(h, w, true);
  func(w, h, false);
  cout << hm << " " << wm << endl;
}
