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 JAVA):

Solution:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Monitor {
    private static void solve2(IO io, long a, long b, long x, long y) {
        long gcd = gcd(x, y);
        x /= gcd;
        y /= gcd;

        // binary search the common multiplier to the x / y ratio
        long low = 0;
        long high = (long) (2 * 1e9); // arbitrary large value
        while (low < high) {
            long mid = low + (high - low + 1) / 2;
            if(x * mid <= a && y * mid <= b)
                low = mid;
            else high = mid - 1;
        }

        io.println((x * low) +" " + (y * low));
    }

    /*private static void solve1(IO io, long a, long b, long x, long y) {
        long gcd = gcd(x, y);
        x /= gcd;
        y /= gcd;

        long low = 0;
        long high = a;
        long a1 = 0;
        while (low < high){
            long mid = low + (high - low + 1) / 2;
            long b1 = (mid * y) / x;
            System.out.println(mid + ", " + b1);
            if(b1 <= b){
                if((mid * y) % x == 0){
                    a1 = mid;
                }

                low = mid;
            }
            else high = mid - 1;
        }

        long b1 = (a1 * y) / x;
        io.println(a1 +" " + b1);
    }*/

    public static void main(String[] args) {
        IO io = new IO();

        long a = io.nextLong();
        long b = io.nextLong();
        long x = io.nextLong();
        long y = io.nextLong();
        //solve1(io, a, b, x, y);
        solve2(io, a, b, x, y);
        io.close();
    }

    static long gcd(long a, long b){
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }
    private static boolean isInteger(double num){
        double numInt = Math.round(num);
        return numInt - num == 0;
    }
    private static class IO extends PrintWriter {

        private BufferedReader br;
        StringTokenizer st;

        public IO() {
            super(System.out);
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        List<Integer> readList(int n){
            List<Integer> list = new ArrayList<>(n);
            for(int i = 0; i < n; ++i)
                list.add(nextInt());
            return list;
        }
        int[] readArray(int n){
            int[] arr = new int[n];
            for(int i = 0; i < n; ++i)
                arr[i] = nextInt();

            return arr;
        }
        long[] readLongArray(int n){
            long[] arr = new long[n];
            for(int i = 0; i < n; ++i)
                arr[i] = nextLong();

            return arr;
        }

        double[] readDoubleArray(int n){
            double[] arr = new double[n];
            for(int i = 0; i < n; ++i)
                arr[i] = nextDouble();
            return arr;
        }
    }
}