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;
inline int LEN(string a) { return a.length(); }
inline int LEN(char a[]) { return strlen(a); }
template <class T>
inline T _abs(T n) {
  return (n < 0 ? -n : n);
}
template <class T>
inline T _max(T a, T b) {
  return (a > b ? a : b);
}
template <class T>
inline T _min(T a, T b) {
  return (a < b ? a : b);
}
template <class T>
inline T _sq(T x) {
  return x * x;
}
template <class T>
inline T _sqrt(T x) {
  return (T)sqrt((double)x);
}
template <class T>
inline T _pow(T x, T y) {
  T z = 1;
  for (int i = 1; i <= (int)y; i++) {
    z *= x;
  }
  return z;
}
template <class T>
inline T _gcd(T a, T b) {
  a = _abs(a);
  b = _abs(b);
  if (!b) return a;
  return _gcd(b, a % b);
}
template <class T>
inline T _lcm(T a, T b) {
  a = _abs(a);
  b = _abs(b);
  return (a / _gcd(a, b)) * b;
}
template <class T>
inline T _isvowel(T s) {
  s = tolower(s);
  if (s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u') return 1;
  return 0;
}
template <class T>
inline T _isupper(T s) {
  if (s >= 'A' and s <= 'Z') return 1;
  return 0;
}
template <class T>
inline T _extended(T a, T b, T &x, T &y) {
  a = _abs(a);
  b = _abs(b);
  T g, x1, y1;
  if (!b) {
    x = 1;
    y = 0;
    g = a;
    return g;
  }
  g = _extended(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
template <class T>
inline T _bigmod(T n, T m) {
  T ans = 1, mult = n % 1000000007;
  while (m) {
    if (m & 1) ans = (ans * mult) % 1000000007;
    m >>= 1;
    mult = (mult * mult) % 1000000007;
  }
  ans %= 1000000007;
  return ans;
}
template <class T>
inline T _modinv(T x) {
  return _bigmod(x, (T)(1000000007 - 2)) % 1000000007;
}
template <class T>
inline T getbit(T x, T i) {
  T t = 1;
  return (x & (t << i));
}
template <class T>
inline T setbit(T x, T i) {
  T t = 1;
  return (x | (t << i));
}
template <class T>
inline T resetbit(T x, T i) {
  T t = 1;
  return (x & (~(t << i)));
}
template <class T>
inline T fastIn() {
  register char c = 0;
  register T a = 0;
  while (c < 33) c = getchar();
  while (c > 33) {
    a = (a * 10) + (c - '0');
    c = getchar();
  }
  return a;
}
int dx[] = {0, +1, 0, -1};
int dy[] = {-1, 0, +1, 0};
struct data {
  long x, y;
};
int main() {
  long long a, b, x, y;
  while (scanf("%lld %lld %lld %lld", &a, &b, &x, &y) == 4) {
    long long g = _gcd(x, y);
    x /= g;
    y /= g;
    long long p = a / x;
    long long q = b / y;
    long long m = _min(p, q);
    printf("%lld %lld\n", m * x, m * y);
  }
  return 0;
}