#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long int c_p(long long int a, long long int n) {
  long long int ans = 1;
  a %= 1000000007;
  if (a == 0) {
    return a;
  }
  while (n > 0) {
    if (n & 1) {
      ans = (ans * a) % 1000000007;
    }
    n = n >> 1;
    a = (a * a) % 1000000007;
  }
  return ans;
}
void sieve_b(long long int* b, long long int max1) {
  for (long long int i = 3; i <= max1; i += 2) {
    b[i] = 1;
  }
  for (long long int i = 3; i <= max1; i += 2) {
    if (b[i] == 1) {
      for (long long int j = i * i; j <= max1; j += i) {
        b[j] = 0;
      }
    }
  }
  b[0] = b[1] = 0;
  b[2] = 1;
}
bool compare(const pair<long long int, string>& x,
             const pair<long long int, string>& y) {
  return (x.first > y.first);
}
long long int mod_add(long long int a, long long int b) {
  long long int ans;
  ans = ((a % 1000000007) + (b % 1000000007)) % 1000000007;
  return (ans % 1000000007);
}
long long int mod_m(long long int a, long long int b) {
  long long int ans;
  ans = ((a % 1000000007) * (b % 1000000007)) % 1000000007;
  return (ans % 1000000007);
}
long long int mod_s(long long int a, long long int b) {
  long long int ans;
  ans = ((a % 1000000007) - (b % 1000000007) + 1000000007) % 1000000007;
  return ans;
}
long long int fun(long long int x) { return c_p(x, 1000000007 - 2); }
long long int count_d(long long int n) {
  long long int c = 0;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        c++;
      } else {
        c += 2;
      }
    }
  }
  return c;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    long long int h, w;
    cin >> h >> w;
    long long int ph = h, pw = w;
    long long int k = log2(w);
    w = (1ll << k);
    if (4 * h > 5 * w) {
      h = 5 * w / 4;
    }
    if (4 * w > 5 * h) {
      w = 5 * h / 4;
    }
    long long int o1 = log2(ph);
    ph = (1ll << o1);
    if (4 * ph > 5 * pw) {
      ph = 5 * pw / 4;
    }
    if (4 * pw > 5 * ph) {
      pw = 5 * ph / 4;
    }
    if (h * w < ph * pw) {
      cout << ph << " " << pw << '\n';
    } else {
      cout << h << " " << w << '\n';
    }
  }
  return 0;
}
