#include <bits/stdc++.h>
using namespace std;
int go(int x) {
  while (x - x & (-x)) {
    x -= x & (-x);
  }
  return x;
}
int main() {
  long long n, m, nn, mm, a = 1, b = 1;
  scanf("%I64d%I64d", &n, &m);
  nn = n, mm = m;
  while (a <= n && m > 0.8 * a) a *= 2;
  a /= 2;
  if (m > 1.25 * a) mm = 1.25 * a;
  while (b <= m && n > 0.8 * b) b *= 2;
  b /= 2;
  if (n > 1.25 * b) nn = 1.25 * b;
  if (a * mm > nn * b || (a * mm == nn * b && a > nn))
    printf("%I64d %I64d\n", a, mm);
  else
    printf("%I64d %I64d\n", nn, b);
  return 0;
}
