#include <bits/stdc++.h>
using namespace std;
int main() {
  long long bigHeight, bigWidth;
  cin >> bigHeight >> bigWidth;
  pair<long long, pair<long long, long long> > max;
  make_pair(0, make_pair(0, 0));
  long long h = 1;
  while (h <= bigHeight) {
    long long w = min(ceil(h * 100 / 80), 1.0 * bigWidth);
    pair<long long, pair<long long, long long> > temp;
    temp = make_pair(h * w, make_pair(h, w));
    if (double(h) * 100 / (w) <= 125 && double(h) * 100 / (w) >= 80 &&
        temp > max)
      max = temp;
    h <<= 1;
  }
  long long w = 1;
  while (w <= bigWidth) {
    long long h = min(1.0 * bigHeight, floor(w * 125 / 100));
    pair<long long, pair<long long, long long> > temp;
    temp = make_pair(h * w, make_pair(h, w));
    if (double(h) * 100 / (w) >= 80 && temp > max && double(h) * 100 / w <= 125)
      max = temp;
    w <<= 1;
  }
  cout << max.second.first << ' ' << max.second.second << endl;
}
