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

Solution:
import sys
from collections import defaultdict as dd
from collections import deque
 
def eprint(*args):
    print(*args, file=sys.stderr)
pl=1
from math import *
import copy
#sys.setrecursionlimit(10**6)
if pl:
	input=sys.stdin.readline
 
def li():
	return [int(xxx) for xxx in input().split()]
def fi():
	return int(input())
def si():
	return list(input().rstrip())	
def mi():
	return 	map(int,input().split())	
 
 
d=[]		
from bisect import *		
 
from itertools import permutations 
from bisect import *
f=[0 for i in range(100)]
 
for i in range(1,100):
	if i==1:
		f[i]=1
	else:
		f[i]=2*f[i-1]+1
 
#print(f[:15])
def rec(n,k):
	s=[]
	while n!=0:
		n,r=n//k,n%k
		#print(n,r)
		if r<0:
			r-=k
			n+=1
		#print(s,n,r)	
		s.append(r)		
	return s		
a,b,x,y=mi()
 
g=gcd(x,y)
x//=g
y//=g
 
l=1
r=10**10
ans=0
aa=[0,0]
while l<=r:
	mid=(l+r)//2
	#print(x*mid,y*mid)
	if x*mid<=a and y*mid<=b:
		ans=max(ans,x*y*mid**2)
		aa=[x*mid,y*mid]
		l=mid+1
	else:
		r=mid-1
print(*aa)