#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long a[33];
  long long h, w, h1, w1, h2, w2;
  long long s = 0;
  h2 = 0;
  w2 = 0;
  cin >> h >> w;
  a[0] = 1;
  int i;
  int tt = 0;
  for (i = 1; i < 32; i++) a[i] = a[i - 1] * 2;
  i = 31;
  while (h < a[i]) i--;
  while (i != -1) {
    h1 = a[i];
    w1 = w;
    if (h1 / 0.8 < w1) w1 = h1 / 0.8;
    while (w1 != 0 && (double)(h1 / w1) <= 1.25) {
      if (h1 * w1 < s) break;
      if ((double)h1 / w1 >= 0.8) {
        s = h1 * w1;
        tt = 1;
        if (h1 > h2) {
          h2 = h1;
          w2 = w1;
        };
        break;
      }
      w1--;
    }
    i--;
  }
  i = 31;
  while (w < a[i]) i--;
  tt = 0;
  while (i != -1) {
    w1 = a[i];
    h1 = h;
    if (w1 * 1.25 < h) h1 = w1 * 1.25;
    while ((double)(h1 / w1) >= 0.8) {
      if (h1 * w1 < s) break;
      if ((double)h1 / w1 <= 1.25) {
        s = h1 * w1;
        tt = 1;
        if (h1 > h2) {
          h2 = h1;
          w2 = w1;
        };
        break;
      }
      h1--;
    }
    i--;
  }
  cout << h2 << " " << w2;
  return 0;
}
