#include<iostream>
using namespace std;

int main ()
{
    int n, n2, k;
    char c, c2;

    cout << "Dobavete purviqt broj i vida my. /x2; 'A'-benzin, 'B'-karolin" << endl;

    cout << "1-vi vid i 1-va brojka: ";
    cin >> n >> c;

    cout << " " << endl;

    cout << "2-ri vid i 2-ra brojka: ";
    cin >> n2 >> c2;

    cout << " " << endl;

    cout << "Kolko varela sa vzeli?: ";
    cin >> k;

    cout << " " << endl;



    if (c=='A')
    {
        if (k>=n)
        {
            cout << "Vzeti vareli s benzin: " << n;
            cout << " " << endl;
        }

        if (k<n)
        {
            cout << "Vzeti vareli s benzin: " << k;
            cout << " " << endl;
        }
    }

    if (c=='B')
    {
        if (k<=n)
        {
            cout << "Vzeti vareli s benzin: " << 0;
            cout << " " << endl;
        }
        if (k>n)
        {
            cout << "Vzeti vareli s benzin: " << k-n;
            cout << " " << endl;
        }
    }

    return 0;
}

