public static void main(String[] args)
	{
		String[] a = StdIn.readAll().split("\\s+");
		int N = a.length;
		BinarySearchTreeSTIterative<String, Integer> st = new BinarySearchTreeSTIterative<String, Integer>();
		for (int i = 0; i < N; i++)
			st.put(a[i], i);
		for (String s : st.keys())
			StdOut.println(s + " " + st.get(s));
	}