#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define MaxN 501
long x, y, px, py;

void End ()
{
  FILE *sc;
        sc = fopen("tmp.txt", "w");
	fprintf(sc, "0\n");
        fclose(sc);
	printf("0\n");
	exit (0);
}

int main (int argc, char *argv[])
{
	FILE *in, *out, *sol, *sc;

	in = fopen (argv [1], "r");
	out = fopen (argv [2], "r");
	sol = fopen (argv [3], "r");
	if ((in == NULL) || (out == NULL) || (sol == NULL)) 
		End ();

	fscanf (out, "%ld %ld", &x, &y);
	fscanf (sol, "%ld %ld", &px, &py);

        sc = fopen("tmp.txt", "w");
	if ((px == x) && (py == y)) {
		fprintf (sc, "10\n");
		printf ("10\n");
	} else {
		fprintf (sc, "0\n");
		printf ("0\n");
        }
        fclose(sc);

	fclose (in);
	fclose (out);
	fclose (sol);
	return 0;
}
