Problem: Reca company makes monitors, the most popular of their models is AB999 with the screen size a × b centimeters. Because of some production peculiarities a screen parameters are integer numbers. Recently the screen sides ratio x: y became popular with users. That's why the company wants to reduce monitor AB999 size so that its screen sides ratio becomes x: y, at the same time they want its total area to be maximal of all possible variants. Your task is to find the screen parameters of the reduced size model, or find out that such a reduction can't be performed.

Input

The first line of the input contains 4 integers — a, b, x and y (1 ≤ a, b, x, y ≤ 2·109).

Output

If the answer exists, output 2 positive integers — screen parameters of the reduced size model. Output 0 0 otherwise.

Examples

Input

800 600 4 3


Output

800 600


Input

1920 1200 16 9


Output

1920 1080


Input

1 1 1 2


Output

0 0

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
vector<bool> prime;
vector<long long> fact, inv, primes, factors;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void factorize(long long a) {
  fact.clear();
  for (long long i = 1; i * i <= a; i++) {
    if (i * i == a)
      factors.push_back(i);
    else if (a % i == 0) {
      factors.push_back(i);
      factors.push_back(a / i);
    }
  }
  sort(factors.begin(), factors.end());
}
long long power(long long a, long long b) {
  if (a == 1 || b == 0) return 1;
  long long c = power(a, b / 2);
  long long res = 1;
  res = c * c;
  if (res >= 1000000007) res %= 1000000007;
  if (b % 2) res *= a;
  if (res >= 1000000007) res %= 1000000007;
  return res;
}
long long modInv(long long a) { return power(a, 1000000007 - 2); }
void factorial(long long n) {
  fact.resize(n + 1);
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = fact[i - 1] * i;
    if (fact[i] >= 1000000007) fact[i] %= 1000000007;
  }
}
void InvFactorial(long long n) {
  inv.resize(n + 1);
  inv[0] = 1;
  for (long long i = 1; i <= n; i++) inv[i] = modInv(fact[i]);
}
long long ncr(long long n, long long r) {
  if (n < r || n < 0 || r < 0) return 0;
  long long b = inv[n - r];
  long long c = inv[r];
  long long a = fact[n] * b;
  if (a >= 1000000007) a %= 1000000007;
  a *= c;
  if (a >= 1000000007) a %= 1000000007;
  return a;
}
void remove_duplicates(vector<pair<long long, long long>> &v) {
  sort(v.begin(), v.end());
  long long _size = unique(v.begin(), v.end()) - v.begin();
  v.resize(_size);
}
unsigned long long gcd(unsigned long long u, unsigned long long v) {
  if (u == 0 || v == 0) return max(u, v);
  unsigned long long shift = __builtin_ctz(u | v);
  u >>= __builtin_ctz(u);
  do {
    v >>= __builtin_ctz(v);
    if (u > v) swap(u, v);
    v -= u;
  } while (v != 0);
  return u << shift;
}
void sieve(long long n) {
  prime.assign(n + 1, 1);
  prime[1] = false;
  for (long long p = 2; p * p <= n; p++)
    if (prime[p])
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
  for (long long i = 2; i < n + 1; i++)
    if (prime[i]) primes.push_back(i);
}
void solve() {
  long long a, b;
  long long x, y;
  cin >> a >> b >> x >> y;
  long long g = gcd(x, y);
  x /= g;
  y /= g;
  long long p1 = -1, p2 = -1;
  long long a1 = a;
  a1 = a1 / x;
  long long b1 = b;
  b1 = b1 / y;
  if (a < x || b < y) {
    cout << 0 << ' ' << 0;
    return;
  }
  cout << min(a / x, b / y) * x << ' ' << min(a / x, b / y) * y;
}
signed main() {
  fast();
  long long T = 1;
  for (long long i = 1; i <= T; i++) solve();
}