import java.util.*;
class dequeueeffqueuechallange {
Stack<Integer> ps= new Stack();
public int dequeue() throws Exception {
try {
return ps.pop();
}
catch(Exception e) {
throw new Exception("queue is empty");
}
}
public void enqueue(int item) throws Exception {
try {
Stack<Integer> hs= new Stack();
while (ps.size() !=0) {
hs.push(ps.pop());
}
hs.push(item);
while(hs.size() !=0) {
ps.push(hs.pop());
}
}
catch(Exception e) {
throw new Exception("queue is full");
}
}
}
public class Main {
public static void main(String[] args) throws Exception {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int [] arr=new int [n];
for(int i=0;i<arr.length;i++) {
arr[i]=i;
}
dequeueeffqueuechallange queue=new dequeueeffqueuechallange();
for(int i=0;i<arr.length;i++) {
queue.enqueue(arr[i]);
}
for(int i=0;i<n;i++) {
System.out.println(queue.dequeue());
}
}
}