import java.io.*;
import java.util.*;

public class champ_pk_sort {

	PrintWriter out;
	BufferedReader br;
	StringTokenizer st;

	String nextToken() throws IOException {
		while ((st == null) || (!st.hasMoreTokens()))
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	class Pair implements Comparable<Pair> {
		String s;
		int num;

		public Pair(String s, int num) {
			super();
			this.s = s;
			this.num = num;
		}

		@Override
		public int compareTo(Pair arg0) {
			if (s.compareTo(arg0.s) != 0)
				return s.compareTo(arg0.s);
			else
				return new Random().nextInt(3) - 1;
		}

	}

	public void solve() throws IOException {
		ArrayList<Pair> a = new ArrayList<champ_pk_sort.Pair>();
		int n = nextInt();
		for (int i = 0; i < n; i++) {
			a.add(new Pair(nextToken(), i + 1));
		}
		Collections.sort(a);
		for (Pair x : a) {
			out.println(x.num);
		}
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			br = new BufferedReader(new FileReader("champ.in"));
			out = new PrintWriter("champ.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new champ_pk_sort().run();
	}
}
