#include<bits/stdc++.h>
using namespace std;
int main(){
int z,x,c,v,b,n;
cin>>v>>z>>x>>c;
if (z<x)swap(z,x);
if (z<c)swap(z,c);
if (x<c)swap(x,c);
b=v/x;
n=v%x;
cout<<b<<" "<<n;
return 0;
}
/**************************************************************
Problem: 1465
User: LYY001
Language: C++
Result: Accepted
Time:13 ms
Memory:2072 kb
****************************************************************/