forest1 = new Array(49);
for(i=0;i<forest1.length;i++) {
  forest1[i] = new Array(1);
}
forest1[0][0] = "801";
forest1[0][1] = "1765";
forest1[1][0] = "871";
forest1[1][1] = "1774";
forest1[2][0] = "1783";
forest1[2][1] = "1752";
forest1[3][0] = "750";
forest1[3][1] = "438";
forest1[4][0] = "633";
forest1[4][1] = "396";
forest1[5][0] = "352";
forest1[5][1] = "935";
forest1[6][0] = "298";
forest1[6][1] = "867";
forest1[7][0] = "267";
forest1[7][1] = "805";
forest1[8][0] = "265";
forest1[8][1] = "631";
forest1[9][0] = "281";
forest1[9][1] = "594";
forest1[10][0] = "297";
forest1[10][1] = "567";
forest1[11][0] = "323";
forest1[11][1] = "527";
forest1[12][0] = "332";
forest1[12][1] = "504";
forest1[13][0] = "365";
forest1[13][1] = "456";
forest1[14][0] = "398";
forest1[14][1] = "435";
forest1[15][0] = "715";
forest1[15][1] = "381";
forest1[16][0] = "928";
forest1[16][1] = "316";
forest1[17][0] = "1137";
forest1[17][1] = "322";
forest1[18][0] = "1175";
forest1[18][1] = "329";
forest1[19][0] = "1443";
forest1[19][1] = "331";
forest1[20][0] = "1529";
forest1[20][1] = "344";
forest1[21][0] = "1605";
forest1[21][1] = "369";
forest1[22][0] = "1670";
forest1[22][1] = "369";
forest1[23][0] = "1842";
forest1[23][1] = "405";
forest1[24][0] = "1874";
forest1[24][1] = "423";
forest1[25][0] = "1928";
forest1[25][1] = "486";
forest1[26][0] = "1971";
forest1[26][1] = "562";
forest1[27][0] = "1993";
forest1[27][1] = "605";
forest1[28][0] = "2006";
forest1[28][1] = "644";
forest1[29][0] = "2012";
forest1[29][1] = "681";
forest1[30][0] = "2026";
forest1[30][1] = "791";
forest1[31][0] = "2059";
forest1[31][1] = "840";
forest1[32][0] = "2089";
forest1[32][1] = "919";
forest1[33][0] = "2093";
forest1[33][1] = "1030";
forest1[34][0] = "1973";
forest1[34][1] = "1763";
forest1[35][0] = "1915";
forest1[35][1] = "1799";
forest1[36][0] = "1251";
forest1[36][1] = "1880";
forest1[37][0] = "988";
forest1[37][1] = "1872";
forest1[38][0] = "934";
forest1[38][1] = "1841";
forest1[39][0] = "457";
forest1[39][1] = "1749";
forest1[40][0] = "526";
forest1[40][1] = "1796";
forest1[41][0] = "278";
forest1[41][1] = "1101";
forest1[42][0] = "267";
forest1[42][1] = "1278";
forest1[43][0] = "312";
forest1[43][1] = "1351";
forest1[44][0] = "328";
forest1[44][1] = "1381";
forest1[45][0] = "363";
forest1[45][1] = "1441";
forest1[46][0] = "400";
forest1[46][1] = "1508";
forest1[47][0] = "477";
forest1[47][1] = "1506";
forest1[48][0] = "345";
forest1[48][1] = "821";
forest2 = new Array(88);
for(i=0;i<forest2.length;i++) {
  forest2[i] = new Array(1);
}
forest2[0][0] = "327";
forest2[0][1] = "1080";
forest2[1][0] = "403";
forest2[1][1] = "943";
forest2[2][0] = "345";
forest2[2][1] = "891";
forest2[3][0] = "306";
forest2[3][1] = "812";
forest2[4][0] = "306";
forest2[4][1] = "733";
forest2[5][0] = "919";
forest2[5][1] = "1793";
forest2[6][0] = "988";
forest2[6][1] = "1829";
forest2[7][0] = "1063";
forest2[7][1] = "1831";
forest2[8][0] = "1142";
forest2[8][1] = "1835";
forest2[9][0] = "1222";
forest2[9][1] = "1834";
forest2[10][0] = "1305";
forest2[10][1] = "1813";
forest2[11][0] = "1386";
forest2[11][1] = "1807";
forest2[12][0] = "1465";
forest2[12][1] = "1813";
forest2[13][0] = "1546";
forest2[13][1] = "1818";
forest2[14][0] = "1624";
forest2[14][1] = "1818";
forest2[15][0] = "1700";
forest2[15][1] = "1811";
forest2[16][0] = "1782";
forest2[16][1] = "1803";
forest2[17][0] = "1860";
forest2[17][1] = "1790";
forest2[18][0] = "1865";
forest2[18][1] = "1744";
forest2[19][0] = "1935";
forest2[19][1] = "1763";
forest2[20][0] = "1934";
forest2[20][1] = "1686";
forest2[21][0] = "1965";
forest2[21][1] = "1713";
forest2[22][0] = "1968";
forest2[22][1] = "1633";
forest2[23][0] = "1979";
forest2[23][1] = "1554";
forest2[24][0] = "1981";
forest2[24][1] = "1480";
forest2[25][0] = "1989";
forest2[25][1] = "1403";
forest2[26][0] = "1991";
forest2[26][1] = "1325";
forest2[27][0] = "2042";
forest2[27][1] = "1128";
forest2[28][0] = "2052";
forest2[28][1] = "1054";
forest2[29][0] = "2054";
forest2[29][1] = "973";
forest2[30][0] = "2049";
forest2[30][1] = "899";
forest2[31][0] = "2010";
forest2[31][1] = "844";
forest2[32][0] = "1970";
forest2[32][1] = "775";
forest2[33][0] = "1965";
forest2[33][1] = "693";
forest2[34][0] = "1948";
forest2[34][1] = "619";
forest2[35][0] = "1929";
forest2[35][1] = "543";
forest2[36][0] = "1885";
forest2[36][1] = "464";
forest2[37][0] = "1854";
forest2[37][1] = "467";
forest2[38][0] = "1783";
forest2[38][1] = "421";
forest2[39][0] = "1704";
forest2[39][1] = "417";
forest2[40][0] = "1624";
forest2[40][1] = "407";
forest2[41][0] = "1546";
forest2[41][1] = "383";
forest2[42][0] = "1468";
forest2[42][1] = "367";
forest2[43][0] = "1384";
forest2[43][1] = "354";
forest2[44][0] = "1307";
forest2[44][1] = "359";
forest2[45][0] = "1229";
forest2[45][1] = "362";
forest2[46][0] = "1147";
forest2[46][1] = "364";
forest2[47][0] = "1072";
forest2[47][1] = "342";
forest2[48][0] = "990";
forest2[48][1] = "337";
forest2[49][0] = "912";
forest2[49][1] = "346";
forest2[50][0] = "832";
forest2[50][1] = "368";
forest2[51][0] = "767";
forest2[51][1] = "383";
forest2[52][0] = "689";
forest2[52][1] = "418";
forest2[53][0] = "655";
forest2[53][1] = "451";
forest2[54][0] = "575";
forest2[54][1] = "419";
forest2[55][0] = "495";
forest2[55][1] = "451";
forest2[56][0] = "575";
forest2[56][1] = "451";
forest2[57][0] = "496";
forest2[57][1] = "417";
forest2[58][0] = "421";
forest2[58][1] = "490";
forest2[59][0] = "446";
forest2[59][1] = "436";
forest2[60][0] = "369";
forest2[60][1] = "507";
forest2[61][0] = "341";
forest2[61][1] = "574";
forest2[62][0] = "313";
forest2[62][1] = "652";
forest2[63][0] = "279";
forest2[63][1] = "764";
forest2[64][0] = "276";
forest2[64][1] = "684";
forest2[65][0] = "1998";
forest2[65][1] = "739";
forest2[66][0] = "2079";
forest2[66][1] = "976";
forest2[67][0] = "1298";
forest2[67][1] = "1840";
forest2[68][0] = "1039";
forest2[68][1] = "1858";
forest2[69][0] = "1115";
forest2[69][1] = "1866";
forest2[70][0] = "1194";
forest2[70][1] = "1870";
forest2[71][0] = "740";
forest2[71][1] = "1786";
forest2[72][0] = "660";
forest2[72][1] = "1796";
forest2[73][0] = "578";
forest2[73][1] = "1790";
forest2[74][0] = "514";
forest2[74][1] = "1747";
forest2[75][0] = "447";
forest2[75][1] = "1695";
forest2[76][0] = "448";
forest2[76][1] = "1618";
forest2[77][0] = "443";
forest2[77][1] = "1544";
forest2[78][0] = "410";
forest2[78][1] = "1467";
forest2[79][0] = "463";
forest2[79][1] = "1455";
forest2[80][0] = "374";
forest2[80][1] = "1396";
forest2[81][0] = "437";
forest2[81][1] = "1379";
forest2[82][0] = "360";
forest2[82][1] = "1314";
forest2[83][0] = "321";
forest2[83][1] = "1237";
forest2[84][0] = "318";
forest2[84][1] = "1154";
forest2[85][0] = "309";
forest2[85][1] = "1300";
forest2[86][0] = "275";
forest2[86][1] = "1223";
forest2[87][0] = "290";
forest2[87][1] = "1158";
montain1 = new Array(20);
for(i=0;i<montain1.length;i++) {
  montain1[i] = new Array(1);
}
montain1[0][0] = "456";
montain1[0][1] = "945";
montain1[1][0] = "501";
montain1[1][1] = "903";
montain1[2][0] = "442";
montain1[2][1] = "848";
montain1[3][0] = "430";
montain1[3][1] = "614";
montain1[4][0] = "468";
montain1[4][1] = "570";
montain1[5][0] = "717";
montain1[5][1] = "539";
montain1[6][0] = "786";
montain1[6][1] = "489";
montain1[7][0] = "1090";
montain1[7][1] = "461";
montain1[8][0] = "1562";
montain1[8][1] = "496";
montain1[9][0] = "1810";
montain1[9][1] = "538";
montain1[10][0] = "1883";
montain1[10][1] = "844";
montain1[11][0] = "1862";
montain1[11][1] = "1628";
montain1[12][0] = "1808";
montain1[12][1] = "1664";
montain1[13][0] = "1738";
montain1[13][1] = "1699";
montain1[14][0] = "961";
montain1[14][1] = "1709";
montain1[15][0] = "801";
montain1[15][1] = "1683";
montain1[16][0] = "870";
montain1[16][1] = "1683";
montain1[17][0] = "799";
montain1[17][1] = "1723";
montain1[18][0] = "868";
montain1[18][1] = "1721";
montain1[19][0] = "401";
montain1[19][1] = "874";
montain2 = new Array(62);
for(i=0;i<montain2.length;i++) {
  montain2[i] = new Array(1);
}
montain2[0][0] = "513";
montain2[0][1] = "961";
montain2[1][0] = "426";
montain2[1][1] = "1100";
montain2[2][0] = "446";
montain2[2][1] = "891";
montain2[3][0] = "405";
montain2[3][1] = "812";
montain2[4][0] = "391";
montain2[4][1] = "733";
montain2[5][0] = "391";
montain2[5][1] = "652";
montain2[6][0] = "425";
montain2[6][1] = "573";
montain2[7][0] = "504";
montain2[7][1] = "533";
montain2[8][0] = "583";
montain2[8][1] = "533";
montain2[9][0] = "662";
montain2[9][1] = "530";
montain2[10][0] = "739";
montain2[10][1] = "495";
montain2[11][0] = "816";
montain2[11][1] = "451";
montain2[12][0] = "898";
montain2[12][1] = "432";
montain2[13][0] = "979";
montain2[13][1] = "422";
montain2[14][0] = "1059";
montain2[14][1] = "427";
montain2[15][0] = "1138";
montain2[15][1] = "449";
montain2[16][0] = "1218";
montain2[16][1] = "446";
montain2[17][0] = "1298";
montain2[17][1] = "437";
montain2[18][0] = "1377";
montain2[18][1] = "435";
montain2[19][0] = "1453";
montain2[19][1] = "435";
montain2[20][0] = "1531";
montain2[20][1] = "459";
montain2[21][0] = "1612";
montain2[21][1] = "486";
montain2[22][0] = "1694";
montain2[22][1] = "498";
montain2[23][0] = "1776";
montain2[23][1] = "503";
montain2[24][0] = "1849";
montain2[24][1] = "550";
montain2[25][0] = "1867";
montain2[25][1] = "631";
montain2[26][0] = "1884";
montain2[26][1] = "710";
montain2[27][0] = "1886";
montain2[27][1] = "790";
montain2[28][0] = "1933";
montain2[28][1] = "863";
montain2[29][0] = "1970";
montain2[29][1] = "930";
montain2[30][0] = "1976";
montain2[30][1] = "1011";
montain2[31][0] = "1961";
montain2[31][1] = "1087";
montain2[32][0] = "1959";
montain2[32][1] = "1146";
montain2[33][0] = "1945";
montain2[33][1] = "1304";
montain2[34][0] = "1925";
montain2[34][1] = "1377";
montain2[35][0] = "1914";
montain2[35][1] = "1457";
montain2[36][0] = "1911";
montain2[36][1] = "1536";
montain2[37][0] = "1905";
montain2[37][1] = "1615";
montain2[38][0] = "1853";
montain2[38][1] = "1667";
montain2[39][0] = "1786";
montain2[39][1] = "1706";
montain2[40][0] = "1710";
montain2[40][1] = "1735";
montain2[41][0] = "1632";
montain2[41][1] = "1739";
montain2[42][0] = "1552";
montain2[42][1] = "1738";
montain2[43][0] = "1471";
montain2[43][1] = "1733";
montain2[44][0] = "1389";
montain2[44][1] = "1728";
montain2[45][0] = "1308";
montain2[45][1] = "1732";
montain2[46][0] = "1227";
montain2[46][1] = "1744";
montain2[47][0] = "1147";
montain2[47][1] = "1757";
montain2[48][0] = "1067";
montain2[48][1] = "1757";
montain2[49][0] = "988";
montain2[49][1] = "1748";
montain2[50][0] = "910";
montain2[50][1] = "1714";
montain2[51][0] = "755";
montain2[51][1] = "1705";
montain2[52][0] = "678";
montain2[52][1] = "1718";
montain2[53][0] = "599";
montain2[53][1] = "1708";
montain2[54][0] = "531";
montain2[54][1] = "1667";
montain2[55][0] = "529";
montain2[55][1] = "1599";
montain2[56][0] = "532";
montain2[56][1] = "1521";
montain2[57][0] = "539";
montain2[57][1] = "1440";
montain2[58][0] = "493";
montain2[58][1] = "1366";
montain2[59][0] = "431";
montain2[59][1] = "1307";
montain2[60][0] = "399";
montain2[60][1] = "1229";
montain2[61][0] = "400";
montain2[61][1] = "1153";
river = new Array(6);
for(i=0;i<river.length;i++) {
  river[i] = new Array(1);
}
river[0][0] = "1201";
river[0][1] = "1026";
river[1][0] = "1199";
river[1][1] = "1007";
river[2][0] = "1213";
river[2][1] = "995";
river[3][0] = "1233";
river[3][1] = "996";
river[4][0] = "1247";
river[4][1] = "1008";
river[5][0] = "1246";
river[5][1] = "1026";
sea1 = new Array(3);
for(i=0;i<sea1.length;i++) {
  sea1[i] = new Array(1);
}
sea1[0][0] = "1190";
sea1[0][1] = "1011";
sea1[1][0] = "1248";
sea1[1][1] = "1014";
sea1[2][0] = "1226";
sea1[2][1] = "1040";
sea2 = new Array(1);
for(i=0;i<sea2.length;i++) {
  sea2[i] = new Array(1);
}
sea2[0][0] = "1217";
sea2[0][1] = "1015";



function checkT(tX, tY, modX, modY) {

	tX = tX - mapSize
	tY = tY - mapSize

	tX = 2500 + (tX - parseInt(tX / 2500) * 2500)
	tY = 2500 + (tY - parseInt(tY / 2500) * 2500)

	tX = tX - parseInt(tX / 2500) * 2500
	tY = tY - parseInt(tY / 2500) * 2500

	for(cht=0;cht<forest1.length;cht++) {
		if(((forest1[cht][0]-forest1ModX)<(tX+modX)) && ((forest1[cht][0]- -forest1ModX)>(tX-modX)) && ((forest1[cht][1]-forest1ModY)<(tY+modY)) && ((forest1[cht][1]- -forest1ModY)>(tY-modY))) return false;
	}
	for(cht=0;cht<forest2.length;cht++) {
		if(((forest2[cht][0]-forest2ModX)<(tX+modX)) && ((forest2[cht][0]- -forest2ModX)>(tX-modX)) && ((forest2[cht][1]-forest2ModY)<(tY+modY)) && ((forest2[cht][1]- -forest2ModY)>(tY-modY))) return false;
	}
	for(cht=0;cht<montain1.length;cht++) {
		if(((montain1[cht][0]-montain1ModX)<(tX+modX)) && ((montain1[cht][0]- -montain1ModX)>(tX-modX)) && ((montain1[cht][1]-montain1ModY)<(tY+modY)) && ((montain1[cht][1]- -montain1ModY)>(tY-modY))) return false;
	}
	for(cht=0;cht<montain2.length;cht++) {
		if(((montain2[cht][0]-montain2ModX)<(tX+modX)) && ((montain2[cht][0]- -montain2ModX)>(tX-modX)) && ((montain2[cht][1]-montain2ModY)<(tY+modY)) && ((montain2[cht][1]- -montain2ModY)>(tY-modY))) return false;
	}
	for(cht=0;cht<river.length;cht++) {
		if(((river[cht][0]-riverModX)<(tX+modX)) && ((river[cht][0]- -riverModX)>(tX-modX)) && ((river[cht][1]-riverModY)<(tY+modY)) && ((river[cht][1]- -riverModY)>(tY-modY))) return false;
	}
	for(cht=0;cht<sea1.length;cht++) {
		if(((sea1[cht][0]-sea1ModX)<(tX+modX)) && ((sea1[cht][0]- -sea1ModX)>(tX-modX)) && ((sea1[cht][1]-sea1ModY)<(tY+modY)) && ((sea1[cht][1]- -sea1ModY)>(tY-modY))) return false;
	}
	for(cht=0;cht<sea2.length;cht++) {
		if(((sea2[cht][0]-sea2ModX)<(tX+modX)) && ((sea2[cht][0]- -sea2ModX)>(tX-modX)) && ((sea2[cht][1]-sea2ModY)<(tY+modY)) && ((sea2[cht][1]- -sea2ModY)>(tY-modY))) return false;
	}

	return true;
}
