import java.util.*;

public class Table2
/* 
 * places keys in table and retreives them in separate method
 *
 */
{
	final static int MAX = 11;
	
	public static void main(String[] asd)
	{
		FileStringReader f = new FileStringReader("out.txt");
		String[] x = new String[11];
		String line;
		for(int j = 0; j < MAX; j++)
		{
			line = f.readLine();
			x[j]= line.trim();//removes trailing spaces
		}
		table(x);//place key and letter in a hash table
	}
	
	public static void table(String[] x)
	{
		Map hash = new HashMap(20);
		String letter;
		String s, key;
		for(int j = 0; j < MAX; j++)
		{
			s = x[j];
			letter = "" + s.charAt(0);
			key = s.substring(1);
			hash.put(key, letter);
		}
		
		retrieve(x, hash);	
	}
	
	public static void retrieve(String[] x, Map hash)
	{
		String letter, key;
		for(int j = 0; j < MAX; j++)
		{
			key = x[j].substring(1);
			letter = (String)hash.get(key);
			System.out.println(letter);
		}
		System.out.println((String)hash.get("1111111111") );
/* if you input a non-existent key into the hash table,
 *with a get, it will return null;
 */
	}
	public static void print(String[] x)
	{
		for(int j = 0; j < MAX; j++)
		{
			System.out.println(x[j] + ":length = "+ x[j].length() );
		}
	}
}


