#include <bits/stdc++.h>
using namespace std;
double w, h, rw, rh;
void get(double w, double h) {
  double best_a = 0;
  double th = 1, tw = 0;
  while (th <= h) {
    int lo = 1, hi = w;
    while (lo <= hi) {
      double mid = (lo + hi) / 2;
      double v = th / mid;
      if (v < 0.8 - 1e-9) {
        hi = mid - 1;
      } else if (v > 1.25) {
        lo = mid + 1;
      } else {
        if (th * mid > best_a) {
          rh = th;
          rw = mid;
          best_a = th * mid;
        }
        lo = mid + 1;
      }
    }
    th *= 2.;
  }
  tw = 1, th = 0;
  while (tw <= w) {
    int lo = 1, hi = h;
    while (lo <= hi) {
      double mid = (lo + hi) / 2;
      if (mid / tw < 0.8 - 1e-9) {
        lo = mid + 1;
      } else if (mid / tw > 1.25) {
        hi = mid - 1;
      } else {
        if (mid * tw >= best_a) {
          rh = mid;
          rw = tw;
          best_a = mid * tw;
        } else if (mid * tw == best_a) {
          if (mid > rh) {
            rh = mid;
            tw = tw;
          }
        }
        lo = mid + 1;
      }
    }
    tw *= 2;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> h >> w;
  get(w, h);
  cout << (int)rh << " " << (int)rw << "\n";
  return 0;
}
