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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.math.BigInteger;

public class C
{
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	static MyScanner sc = new MyScanner(System.in);
	static StringBuilder output = new StringBuilder();
	
	public static void main(String... args)
	{
		int a = sc.nextInt();
		int b = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		
		int gcd = MathUtil.gcd(x, y);
		
		x /= gcd;
		y /= gcd;
		
		int ratioX = a / x;
		int ratioY = b / y;
		int ratio = Math.min(ratioX, ratioY);
		
		output.append(x * ratio);
		output.append(" ");
		output.append(y * ratio);
		
		
		eOP();
	}

	private static void eOP()
	{
		System.out.println(output);
		System.exit(0);
	}
	
	private static final class MathUtil 
	{
		private MathUtil()
		{
			
		}
		
		private enum Key
		{
			KEY;
		}
		
		public static BigInteger BigIntegerOf(String expression, Object... args)
		{
			expression = String.format(expression, args);
			expression = expression.replaceAll(" ", "");
			
			int bracketEnd;
			bracketEnd = expression.indexOf(")");
			while (bracketEnd != -1)
			{
				int bracketStart = expression.substring(0, bracketEnd)
						.lastIndexOf("(");
				
				expression = expression.substring(0, bracketStart)
						+ bigIntegerOf(expression.substring(bracketStart + 1, bracketEnd), Key.KEY)
						+ expression.substring(bracketEnd + 1);
				
				bracketEnd = expression.indexOf(")");
			}
			
			return bigIntegerOf(expression, Key.KEY);
		}
		
		private static BigInteger bigIntegerOf(String expression, Key key)
		{
			// TODO
			return null;
		}

		public static int gcd(int... vals)
		{
			int result = 0;
			
			for (int val : vals)
			{
				result = gcd(result, val, Key.KEY);
			}
			
			return result;
		}

		public static int lcm(int... vals)
		{
			int result = 1;
			
			for (int val : vals)
			{
				result = lcm(result, val, Key.KEY);
			}
			
			return result;
		}
		
		private static int lcm(int val0, int val1, Key key)
		{
			if (val0 == 0 || val1 == 0)
			{
				return 0;
			}
			
			return val0 / gcd(val0, val1, Key.KEY) * val1;
		}

		private static int gcd(int val0, int val1, Key key)
		{
			while(val1 != 0)
			{
				int temp = val0 % val1;
				val0 = val1;
				val1 = temp;
			}
			return val0;
		}
		
		
	}

	
	/**
	 * Flatfoot's Scanner with slight modifications.
	 * @author <a href="http://codeforces.com/profile/Flatfoot">Flatfoot</a>
	 * @see <a href="http://codeforces.com/blog/entry/7018">Source</a> 
	 */
	private static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		
		MyScanner(InputStream in)
		{
			this.br = new BufferedReader(new InputStreamReader(in));
		}
		
		String next()
		{
			while (this.st == null || !this.st.hasMoreElements())
			{
				try
				{
					this.st = new StringTokenizer(this.br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return this.st.nextToken();
		}
		
		int nextInt()
		{
			return Integer.parseInt(this.next());
		}
		
		long nextLong()
		{
			return Long.parseLong(this.next());
		}
		
		double nextDouble()
		{
			return Double.parseDouble(this.next());
		}
		
		String nextLine()
		{
			String str = "";
			try
			{
				str = this.br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
		
	}
}