private static String decode(String str)
	{
		//Separate key from cipher
		String[] arr = str.split("\\|");
		String key = arr[0];
		String answer = "";
		String[] cipher = arr[1].split(" ");
		int num;
		for(int i = 1; i < cipher.length; i++)
		{
			num = Integer.parseInt(cipher[i]);
			answer += key.charAt(num - 1);
		}
		
		return answer;		
	}