//Vaibhav Patil
//3/12/20
//Int5
//Enloe
//Potter
//Contest 3

# include 
# include 
# include 
# include 
using namespace std;

string bintoHex(string deca){
    if (deca == "0000")
        return "0";
    if (deca == "0001")
        return "1";
    if (deca == "0010")
        return "2";
    if (deca == "0011")
        return "3";
    if (deca == "0100")
        return "4";
    if (deca == "0101")
        return "5";
    if (deca == "0110")
        return "6";
    if (deca == "0111")
        return "7";
    if (deca == "1000")
        return "8";
    if (deca == "1001")
        return "9";
    if (deca == "1010")
        return "A";
    if (deca == "1011")
        return "B";
    if (deca == "1100")
        return "C";
    if (deca == "1101")
        return "D";
    if (deca == "1110")
        return "E";
    if (deca == "1111")
        return "F";

}

string noteval(char var){
    if (var == '1')
        return "0";
    else if (var == '0')
        return "1";
}

string oreval(char var1, char var2){
    if (var1 == '1' || var2 == '1')
        return "1";
    else
        return "0";
}

string andeval(char var1, char var2){
    if (var1 == '1' && var2 == '1')
        return "1";
    else
        return "0";
}

char evaluate(string sub){
    for (int i = 0;i