public static void main(String[] args) throws FileNotFoundException{
		
		//-686902
		answer =0;
		inputgraph();
		explored.add(1);
		for(int j = 0; j <501; j++){
			findnextvertextotraverse();
			System.out.print(vertextotransverse);
			System.out.print("\n");
			explored.add(vertextotransverse);
		answer = answer + edgewieght[vertextotransformfrom][vertextotransverse];
			
			}
	for(int m=0;m<501;m++){
		if(!(explored.contains(m))){
			System.out.print("wrong answer");
		}
	}
		System.out.print(answer);
	}