#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  double h, w;
  cin >> h >> w;
  int ans1, ans2, mx = 0;
  long long int i = 1;
  while (i * 2 <= h && i * 2 <= w) {
    i *= 2;
  }
  ans1 = min((long long int)h, (long long int)(1.25 * i));
  ans2 = min((long long int)w, (long long int)(1.25 * i));
  if (ans1 >= ans2)
    cout << ans1 << " " << i;
  else
    cout << i << " " << ans2;
  return 0;
}
