#define NOFOOTER
#include "testlib.h"
#include <string>
 
void trim_number(std::string &str)
{
    unsigned last = str.length();
    while (last > 0 && str[last - 1] <= ' ')
    {
        --last;
    }
    unsigned first = 0;
    while (first < last && str[first] == '0')
    {
        ++first;
    }
    str = str.substr(first, last - first);
}

bool check_number(std::string const &str)
{
    for (unsigned i = 0; i < str.length(); ++i)
    {
        if ('0' > str[i] || str[i] > '9')
        {
            return false;
        }
    }
    return true;
}
 
int main(int argc, char **argv)
{
    registerTestlibCmd(argc, argv);
    std::string jury = ans.readString();
    std::string cont = ouf.readString();
    trim_number(jury);
    trim_number(cont);
    
    if (!check_number(jury))
    {
        quitf(_fail, "Jury answer is not a non-negative integer number");
    }
    if (!check_number(cont))
    {
        quitf(_pe, "Contestant's answer is not a non-negative integer number");
    }
    if (jury == cont)
    {
        quitf(_ok, "Ok (%s)", jury.c_str());
    }
    else
    {
        quitf(_wa, "Expected %s, found %s", jury.c_str(), cont.c_str());
    }
}
