#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long h, w;
  cin >> h >> w;
  long long pow2max = 1;
  while (2 * pow2max <= h && 2 * pow2max <= w) pow2max *= 2;
  long long hmax = min(h, (long long)(1.25 * pow2max));
  long long wmax = min(w, (long long)(1.25 * pow2max));
  if (hmax >= wmax)
    cout << hmax << " " << pow2max;
  else
    cout << pow2max << " " << wmax;
  return;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
