#include <bits/stdc++.h>

using namespace std;

void solve(){
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    int rs = a + b + c;
    cout << max(0, n - rs) << '\n';
    cout << n - max(a, max(b, c)) << '\n';
}

int main() {
    ios_base::sync_with_stdio(false);
    solve();
    // TIP See CLion help at <a href="https://www.jetbrains.com/help/clion/">jetbrains.com/help/clion/</a>. Also, you can try interactive lessons for CLion by selecting 'Help | Learn IDE Features' from the main menu.
}