#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000 + 10;
const int INF = 0x7f7f7f7f;
const double eps = 1e-8;
const double pi = 3.1415926535897932384626433832795;
int main() {
  double t1;
  long long hh, ww, h1, w1, h2, w2, t2;
  cin >> hh >> ww;
  for (int i = 30; i >= 0; i--)
    if (hh >= (1 << i)) {
      h1 = 1 << i;
      t1 = h1 / 1.25;
      t2 = h1 * 5 / 4;
      if (ww - t1 < -eps) continue;
      w1 = min(ww, t2);
      break;
    }
  for (int i = 30; i >= 0; i--)
    if (ww >= (1 << i)) {
      w2 = 1 << i;
      t1 = w2 / 1.25;
      t2 = w2 * 5 / 4;
      if (hh - t1 < -eps) continue;
      h2 = min(hh, t2);
      break;
    }
  if (h1 * w1 > h2 * w2)
    cout << h1 << " " << w1 << endl;
  else if (h1 * w1 < h2 * w2)
    cout << h2 << " " << w2 << endl;
  else if (h1 > h2)
    cout << h1 << " " << w1 << endl;
  else
    cout << h2 << " " << w2 << endl;
  return 0;
}
