#include <bits/stdc++.h>
using namespace std;
void testCase() {
  double height, width;
  cin >> height >> width;
  int w = 1;
  while (w <= width && w <= height) w <<= 1;
  w >>= 1;
  int l = 1, r = max(height, width);
  int ans = 0;
  while (r >= l) {
    int mid = l + (r - l) / 2;
    double temp = (double(mid) / w);
    if (temp > 1.25)
      r = mid - 1;
    else if (temp < 0.8)
      l = mid + 1;
    else {
      ans = max(ans, mid);
      l = mid + 1;
    }
  }
  if (ans > height) {
    cout << w << ' ' << ans;
    return;
  }
  cout << ans << ' ' << w;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  testCase();
  return 0;
}
