private int[] breadthFirstSearch(Scanner inputFile, int maxNode)
	{
		HashMap<Integer, ArrayList<Integer>> nodes = new HashMap<Integer, ArrayList<Integer>>();
		
		while(inputFile.hasNext())
		{
			int key = inputFile.nextInt(), value = inputFile.nextInt();
			
			if(nodes.containsKey(key))
			{
				ArrayList<Integer> values = nodes.get(key);
				values.add(value);
				nodes.put(key, values);
			}
			else
			{
				nodes.put(key, new ArrayList<Integer>() {{add(value);}});
			}
		}
		
		int[] answer = new int[maxNode];
		Arrays.fill(answer, -1);
		answer[0] = 0;
		ArrayList<Integer>currentNodes = nodes.get(1);
		int count = 1;
		while(currentNodes.size() > 0)
		{
			ArrayList<Integer> nextNodes = new ArrayList<Integer>();
			for(Integer currentNode : currentNodes)
			{
				if(answer[currentNode - 1] == -1)
				{
					answer[currentNode - 1] = count;
				}
				if(nodes.containsKey(currentNode))
				{
					for(Integer nextNode : nodes.get(currentNode))
					{
						if(answer[nextNode - 1] == -1)
						{
						nextNodes.add(nextNode);
						}
					}
				}
				
			}
			currentNodes = nextNodes;
			count++;
		}
		
		return answer;
	}