public class Solution {
    public static void main(String[] args) throws Exception {
         ArrayList<String> s = new ArrayList<String>();
         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

for (int i = 0; i<10; i++){
     s.add(0, reader.readLine());   // вот в этой строке

}
  for (int i = 0; i<10; i++){
       System.out.println(s.get(i));}

    }
}