#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, a, b, c;
cin >> n >> a >> b >> c;
int prices[3] = {a, b, c};
sort(prices, prices + 3);
int mid = prices[1];
int cnt = n / mid;
int change = n % mid;
cout << cnt << " " << change;
return 0;
}
/**************************************************************
Problem: 1465
User: fuhoubin
Language: C++
Result: Accepted
Time:30 ms
Memory:2076 kb
****************************************************************/