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.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
//        InputStream inputStream = new FileInputStream("sum.in");
        OutputStream outputStream = System.out;
//        OutputStream outputStream = new FileOutputStream("sum.out");


//        Path path = Paths.get(URI.create("file:///foo/bar/Main.java"));
//        System.out.print(path.getName(200));

//        Path p = Paths.get("/foo/bar/Main.java");
//        for (Path e : p) {
//            System.out.println(e);
//        }

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Answer solver = new Answer();
        solver.solve(in, out);
        out.close();
    }
}

class Answer {
    private final int INF = (int) (1e9 + 7);
    private final int MOD = (int) (1e9 + 7);
    private final int MOD1 = (int) (1e6 + 3);
    private final long INF_LONG = (long) (1e18 + 1);
    private final double EPS = 1e-9;

    private class Pair {
        long a;
        long b;

        public Pair(long a, long b) {
            this.a = a;
            this.b = b;
        }
    }

    private Pair bin(int l, int r, int b0, int x, int y) {
        if (l > r) {
            return null;
        }

        int i = (l + r) >> 1;
        if (1L * i * y > b0) {
            return bin(l, i - 1, b0, x, y);
        }

        Pair t = bin(i + 1, r, b0, x, y);
        if (t != null) {
            return t;
        }

        return new Pair(1L * i * x, 1L * i * y);

    }

    private int gcd(int a, int b) {
        return (b == 0) ? a : gcd(b, a % b);
    }

    public void solve(InputReader in, PrintWriter out) throws IOException {
        int a = in.nextInt();
        int b = in.nextInt();
        int x = in.nextInt();
        int y = in.nextInt();

        int g = gcd(x, y);
        x /= g;
        y /= g;

//        out.println(x + " " + y);

        Pair ans = bin(1, a / x, b, x, y);
        if (ans == null) {
            out.print("0 0");
            return;
        }

        out.print(ans.a + " " + ans.b);

    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

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

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

    public int[] nextArrayInt(int count) {
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public long[] nextArrayLong(int count) {
        long[] a = new long[count];
        for (int i = 0; i < count; i++) {
            a[i] = nextLong();
        }
        return a;
    }
}