#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  long long ax = 1, x = 2, s;
  long long ay = 1, y = 2;
  while (true) {
    if (x > n) break;
    y = x;
    if (x >= 4) y = x + (x >> 2);
    if (y > m) y = m;
    if (x * 4 > y * 5) break;
    ax = x;
    ay = y;
    s = x * y;
    x *= 2;
  }
  x = 2;
  y = 2;
  while (true) {
    if (x > m) break;
    y = x;
    if (x >= 4) y = x + (x >> 2);
    if (y > n) y = n;
    if (x * 4 > y * 5) break;
    if (s < x * y) {
      ax = x;
      ay = y;
      s = x * y;
    }
    x *= 2;
  }
  swap(ax, ay);
  if (ax > n) swap(ax, ay);
  cout << ax << " " << ay << endl;
  return 0;
}
