#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const int DIRX[] = {-1, 0, 0, 1, -1, -1, 1, 1},
          DIRY[] = {0, -1, 1, 0, -1, 1, -1, 1};
const double ERR = 1e-9, PI = (2 * acos(0.0));
template <class T>
inline int size(T& t) {
  return (int)t.size();
}
template <class T>
inline T MIN(T a, T b) {
  return ((a < b) ? a : b);
}
template <class T>
inline T MAX(T a, T b) {
  return ((b < a) ? a : b);
}
template <class T>
inline void checkMIN(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkMAX(T& a, T b) {
  if (a < b) a = b;
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first * a.second != b.first * b.second)
    return (a.first * a.second > b.first * b.second);
  if (a.first != b.first) return (a.first > b.first);
  return false;
}
int main() {
  long long x, y, a, b, aa, bb, i, j, xx, yy;
  while (cin >> x >> y) {
    vector<pair<long long, long long> > v;
    for (i = 1; i <= x; i *= 2) {
      if (y > i) {
        yy = MIN(y, (5 * i) / 4);
        v.push_back(make_pair(i, yy));
      }
      if (y <= i && 4 * i <= 5 * y) {
        v.push_back(make_pair(i, y));
      }
    }
    for (j = 1; j <= y; j *= 2) {
      if (x > j) {
        xx = MIN(x, (5 * j) / 4);
        v.push_back(make_pair(xx, j));
      }
      if (x <= j && 4 * j <= 5 * x) {
        v.push_back(make_pair(x, j));
      }
    }
    sort((v).begin(), (v).end(), comp);
    cout << v[0].first << " " << v[0].second << endl;
  }
  return 0;
}
