#include <stdio.h>
void main()
{
int a , b , c , money , t ;
double s;
scanf("%d %d %d %d",&money,&a,&b,&c);
if(b < a){
t = a;
a = b;
b = t;
}
if(c < a){
t = a;
a = c;
c = t;
}
if(c < b){
t = b;
b = c;
c = t;
}
printf("%d %d",money/b,money%b);
}
/**************************************************************
Problem: 1465
User: admin
Language: C
Result: Accepted
Time:17 ms
Memory:1144 kb
****************************************************************/