#include <bits/stdc++.h>
using namespace std;
int main() {
  int l, w;
  cin >> l >> w;
  int k = 1;
  while (2 * k <= l && 2 * k <= w) {
    k = k * 2;
  }
  int bl = min(l, int(1.25 * k));
  int bw = min(w, int(1.25 * k));
  if (bl >= bw) {
    cout << bl << " " << k << endl;
  } else
    cout << k << " " << bw << endl;
  return 0;
}
