a,b,c,d = map(int,input().split())
if b < c:
    t = b
    b = c
    c = t
if b < d:
    t = b
    b = d
    d = t
if c < d:
    t = c
    c = d
    d = t
print(a//c, a%c)
/**************************************************************
	Problem: 1465
	User: admin
	Language: Python
	Result: Accepted
	Time:189 ms
	Memory:34480 kb
****************************************************************/