#include<bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long int n;
    unsigned long long int loadO, loadA, loadB, loadAB;
    cin >> n;
    cin >> loadO >> loadA >> loadB >> loadAB;
    string krv[n];
    unsigned long long int num[n];
    for(int i=0;i<n;++i)
    {
        cin >> krv[i] >> num[i];
    }
    cout << "nemoguce";
    return 0;
}