{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eMr. X is very fond of the novel “The House of Doctor Dee”, which is set in\r\nLondon in the 16th century and in the end of the 20th century. Rereading the\r\nnovel once again, Mr. X decided to draw a map of London with routes of the\r\nprotagonists Dr. Dee and Matthew Palmer. Dr.Dee, who lived in the 16th\r\ncentury, often traveled from his house to St. Paul\u0027s Cathedral, and Matthew,\r\nwho lived in the 20th century, regularly walked from the National Gallery to\r\nthe British Museum.\r\n\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eEvery time it turned out that the protagonists were at the same point in\r\nLondon, Dr. Dee had visions about what was happening to Matthew at that moment.\r\nSuch moments were often enough, and Mr. X decided to draw the motion\r\ntrajectories of Dr. Dee and Matthew in such a way that their common part be as\r\nlong as possible. However, Mr. X is not very good at the topography of London.\r\nHe assumes that the city is built by a rectangular scheme—each street\r\nstretches through the whole city either from west to east or from north to\r\nsouth. The house of Dr. Dee, St. Paul\u0027s Cathedral, the National Gallery, and\r\nthe British Museum are located exactly at the intersections of two orthogonal\r\nstreets. Moreover, Mr. X is sure that Dr. Dee and Matthew always took one of\r\nthe shortest possible routes.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThough London is very big, Mr. X has already drawn its map. He has also marked\r\nDr. Dee\u0027s house, St. Paul\u0027s Cathedral, the National Gallery, and the British\r\nMuseum on the map. It now remains to draw the required routes.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line contains coordinates of Dr. Dee\u0027s house separated\r\nwith a space. The following lines contain the coordinates of St. Paul\u0027s\r\nCathedral, the National Gallery, and the British Museum in the same format. All\r\nthe coordinates are integers with absolute values not exceeding 10\u003csup\u003e9\u003c/sup\u003e.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the maximum length of the path that Dr. Dee and Matthew\r\nPalmer\u0027s routes can have in common.\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 2\r\n4 4\r\n5 5\r\n3 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}