#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1005;
long long po[33], ansh, answ, ans;
void init() {
  po[0] = 1;
  for (int i = 1; i <= 30; i++) po[i] = po[i - 1] * 2;
}
void work(long long h, long long w) {
  for (int i = 0; i <= 30; i++) {
    if (po[i] > h) return;
    if (po[i] * 8 > w * 10) return;
    long long tempw = floor(po[i] * 1.25);
    tempw = min(tempw, w);
    long long rans = tempw * po[i];
    if (rans > ans) {
      ans = rans;
      ansh = po[i];
      answ = tempw;
    } else if (rans == ans && po[i] >= ansh) {
      ansh = po[i];
      answ = tempw;
    }
  }
}
void exwork(long long h, long long w) {
  for (int i = 0; i <= 30; i++) {
    if (po[i] > h) return;
    if (po[i] * 8 > w * 10) return;
    long long tempw = floor(po[i] * 1.25);
    tempw = min(tempw, w);
    long long rans = tempw * po[i];
    if (rans > ans) {
      ans = rans;
      ansh = tempw;
      answ = po[i];
    } else if (rans == ans && tempw >= ansh) {
      ansh = tempw;
      answ = po[i];
    }
  }
}
int main() {
  init();
  long long h, w;
  scanf("%I64d%I64d", &h, &w);
  ans = ansh = answ = 0;
  work(h, w);
  exwork(w, h);
  printf("%I64d %I64d\n", ansh, answ);
  return 0;
}
