#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = ' ';
  int f = 1, x = 0;
  while (!isdigit(ch)) {
    ch = getchar();
    if (ch == '-') f *= -1;
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return f * x;
}
double ans = 0;
long long ansx = 0, ansy = 0;
int main() {
  long long h = read(), w = read();
  long long p1 = 1, p2 = 1;
  while (p1 <= h) p1 *= 2;
  p1 /= 2;
  while (p2 <= w) p2 *= 2;
  p2 /= 2;
  double l1 = p1 * 0.8, l2 = p2 * 0.8, r1 = p1 * 1.25, r2 = p2 * 1.25;
  if (w >= l1) {
    if (w < r1) {
      if (ans < p1 * w * 1.0) ans = p1 * w, ansx = p1, ansy = w;
    } else {
      if (ans < p1 * r1) ans = p1 * r1, ansx = p1, ansy = r1;
    }
  }
  if (h >= l2) {
    if (h < r2) {
      if (ans < p2 * h * 1.0) ans = p2 * h, ansx = h, ansy = p2;
    } else {
      if (ans < p2 * r2) ans = p2 * r2, ansx = r2, ansy = p2;
    }
  }
  if (ansx < ansy && ansx <= w && ansy <= h) swap(ansx, ansy);
  cout << ansx << " " << ansy;
  return 0;
}
