#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
int main() {
  long long a, n = 0, m = 0, h, s, a1[1 << 7], a2[1 << 7];
  cin >> h >> s;
  long long s1 = s;
  long long h1 = h;
  long long k = 1;
  while ((1 << n) < h) ++n;
  if (n) --n;
  while ((1 << m) < s) ++m;
  if (m) --m;
  if (((!(h & (h - 1))) || (!(s & (s - 1)))) && h * 100 <= 125 * s &&
      h * 100 >= 80 * s) {
    cout << h << " " << s;
    return 0;
  }
  h = 1 << n;
  s = 1 << m;
  int mxh, mxs;
  {
    {
      if (h * 100 <= 125 * s) {
        while (h * 100 <= 125 * s && h * 100 >= 80 * s) {
          if (h == h1) break;
          ++h;
          if (!(h * 100 <= 125 * s && h * 100 >= 80 * s)) {
            --h;
            break;
          }
        }
      }
      mxh = h;
      h = 1 << n;
      if (h * 100 >= 80 * s) {
        while (h * 100 <= 125 * s && h * 100 >= 80 * s) {
          if (s == s1) break;
          ++s;
          if (!(h * 100 <= 125 * s && h * 100 >= 80 * s)) {
            --s;
            break;
          }
        }
      }
      mxs = s;
      s = 1 << m;
      long long p1 = (long long)mxh * (long long)s;
      long long p2 = (long long)mxs * (long long)h;
      if (p1 >= p2) {
        cout << mxh << " " << s;
        return 0;
      } else {
        cout << h << " " << mxs;
        return 0;
      }
    }
  }
  cout << h << " " << s;
  return 0;
}
