#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b, c, d;
int main() {
  cin >> n >> m;
  if (n > m) {
    a = (1 << (long long)(log2(min(n, (long long)(m * 1.25)))));
    b = min((long long)(a * 1.25), m);
    d = (1 << (long long)(log2(m)));
    c = min((long long)(d * 1.25), n);
  } else if (n < m) {
    a = (1 << (long long)(log2(n)));
    b = min((long long)(a * 1.25), m);
    d = (1 << (long long)(log2(min((long long)(n * 1.25), m))));
    c = min((long long)(d * 1.25), n);
  } else {
    a = (1 << (long long)(log2(n)));
    b = min((long long)(a * 1.25), m);
    d = (1 << (long long)(log2(m)));
    c = min((long long)(d * 1.25), n);
  }
  if (a * b > c * d)
    cout << a << " " << b << '\n';
  else if (a * b < c * d)
    cout << c << " " << d << '\n';
  else {
    if (a > c)
      cout << a << " " << b << '\n';
    else
      cout << c << " " << d << '\n';
  }
}
