import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<List<Integer>> r = new ArrayList<>();
        for(int i = 0; i < Math.ceil((double)n/m); ++i){//天花板保证车位足够
            List<Integer> temp = new ArrayList<>();
            for(int j = 0; j < m; ++j){
                if(sc.hasNext()) temp.add(sc.nextInt());
            }
            r.add(temp);
        }
        boolean flag = false;
        for(int i = r.size() - 1; i >= 0; --i){//逆序输出即可
            for(int j = 0; j < r.get(i).size(); ++j){
                if(flag) System.out.print(" ");//第一个不用输出空格
                else flag = true;
                System.out.print(r.get(i).get(j));
            }
        }
    }
}