#include<bits/stdc++.h>
using namespace std;
int main(){
	int x,a,b,c,z,q;
	cin>>x>>a>>b>>c;
	if(a>b)swap(a,b);
	if(a>c)swap(a,c);
	if(b>c)swap(b,c);
	z=x/b;
	q=x-z*b;
	cout<<z<<" "<<q;
	return 0;
}

/**************************************************************
	Problem: 1465
	User: tangkaixuan
	Language: C++
	Result: Accepted
	Time:14 ms
	Memory:2072 kb
****************************************************************/