import java.io.*; import java.util.*; class Main { public static void main(String args[])throws Exception { BufferedReader bu=new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb=new StringBuilder(); String s[]=bu.readLine().split(" "); int n=Integer.parseInt(s[0]),i; long m=Long.parseLong(s[1]),k=Long.parseLong(s[2]),sum=0; Deque dq=new LinkedList<>(); for(i=0;i q=new LinkedList<>(); while(cur>=0 && k-cur>=0) //one by one take largest and place it after the last appended value { q.add(dq.pollLast()); k-=cur; cur--; } while(!q.isEmpty()) sb.append(q.poll()+"\n"); while(dq.size()>k+1) sb.append(dq.pollFirst()+"\n"); if(!dq.isEmpty()) sb.append(dq.pollLast()+"\n"); while(!dq.isEmpty()) sb.append(dq.pollFirst()+"\n"); System.out.print(sb); } }