#include <stdio.h>

int cn, n;
float cx,cy,cz;
float x,y,z;

int main(int argc,char **argv)
{
	FILE *cro = fopen (argv[2], "rt");
	FILE *fro = fopen (argv[3], "rt");

	while (fscanf(cro, "Map #%d\nThe treasure is located at (%f,%f).\nThe distance to the treasure is %f.\n\n", &cn, &cx, &cy, &cz) == 4)
	{
		if (fscanf(fro, "Map #%d\nThe treasure is located at (%f,%f).\nThe distance to the treasure is %f.\n\n", &n, &x, &y, &z) != 4)
			return 1;

		if (cn != n)
			return 1;

		if (x < cx - 0.001 || x > cx + 0.001)
			return 1;
		if (y < cy - 0.001 || y > cy + 0.001)
			return 1;
		if (z < cz - 0.001 || z > cz + 0.001)
			return 1;
	}

	return 0;
}
