#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>

static const std::string PASSWORD = "48cmj1xkg85js3jd932g";

double TARGET = 3700;

int main(int argc, char *argv[])
{
    std::ifstream in(argv[1]);
    std::ifstream sol(argv[2]);
    std::ifstream out(argv[3]);

    if (!in)
    {
        std::cerr << "In-file " << argv[1] << " not found." << std::endl;
        std::cout << 0 << std::endl;
        return 0;
    }

    if (!sol)
    {
        std::cerr << "Sol-file " << argv[1] << " not found." << std::endl;
        std::cout << 0 << std::endl;
        return 0;
    }

    if (!out)
    {
        std::cerr << "Out-file " << argv[1] << " not found." << std::endl;
        std::cout << 0 << std::endl;
        return 0;
    }

    long long solAns;
    sol >> solAns;

    std::string pass;
    out >> pass;

    if (pass != PASSWORD)
    {
        std::cerr << "Your program wrote to stdout." << std::endl;
        std::cout << 0 << std::endl;
        return 0;
    }

    long long outAns;
    out >> outAns;

    if (outAns != solAns)
    {
        std::cout << 0 << std::endl;
        return 0;
    }

    std::cout << 1 << std::endl;

    return 0;
}
