public class Solution {
    public static void main(String[] args) throws Exception {
        ArrayList<String> str = new ArrayList<String>();
        BufferedReader dr = new BufferedReader(new InputStreamReader(System.in));
        for (int i = 0; i < 10; i++) {

            str.add(i, dr.readLine());
        for(int a = 0; a < 13; a++) {
        String s = str.get(9);
        str.remove(s);
        str.add(0, s);
        }
        System.out.println(str.get(i));

        }
    }
}