#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const int oo = 1e+9;
double h, w;
pair<double, double> ans(1, 1);
int main() {
  cin >> w >> h;
  double hh, ww;
  for (hh = 1; hh <= h; hh *= 2) {
    ww = min(int(1.25 * hh), int(w));
    if (ww / hh >= 0.8 && ww * hh > ans.first * ans.second)
      ans.first = ww, ans.second = hh;
  }
  for (ww = 1; ww <= w; ww *= 2) {
    hh = min(int(1.25 * ww), int(h));
    if (hh / ww >= 0.8 && ww * hh > ans.first * ans.second)
      ans.first = ww, ans.second = hh;
  }
  cout << int(ans.first) << ' ' << int(ans.second);
  return 0;
}
