	}

	int x1, x2, y1, y2;
	scanf("%d,%d,%d,%d",&x1,&x2,&y1,&y2);

	//processing

	int lowest = wfloyd(n,x1,x2) + wfloyd(n,x2,x1),
		res = y1 - y2 - lowest;

	std::cout << wfloyd(n,x1,x2) << std::endl;
	std::cout << wfloyd(n,x2,x1) << std::endl;
	std::cout << res << std::endl;
	return 0;
}