🏡 index : github.com/captn3m0/codechef.git

---
{"category_name":"easy","problem_code":"BSHUFFLE","problem_name":"Bad Shuffle","languages_supported":{"0":"C","1":"CPP14","2":"JAVA","3":"PYTH","4":"PYTH 3.6","5":"PYPY","6":"CS2","7":"PAS fpc","8":"PAS gpc","9":"RUBY","10":"PHP","11":"GO","12":"NODEJS","13":"HASK","14":"rust","15":"SCALA","16":"swift","17":"D","18":"PERL","19":"FORT","20":"WSPC","21":"ADA","22":"CAML","23":"ICK","24":"BF","25":"ASM","26":"CLPS","27":"PRLG","28":"ICON","29":"SCM qobi","30":"PIKE","31":"ST","32":"NICE","33":"LUA","34":"BASH","35":"NEM","36":"LISP sbcl","37":"LISP clisp","38":"SCM guile","39":"JS","40":"ERL","41":"TCL","42":"kotlin","43":"PERL6","44":"TEXT","45":"SCM chicken","46":"PYP3","47":"CLOJ","48":"COB","49":"FS"},"max_timelimit":0.5,"source_sizelimit":50000,"problem_author":"bciobanu","problem_tester":null,"date_added":"3-09-2018","tags":{"0":"bciobanu","1":"data","2":"hashing","3":"implementation","4":"probability","5":"sept18","6":"simulation"},"editorial_url":"https://discuss.codechef.com/problems/BSHUFFLE","time":{"view_start_date":1537176602,"submit_start_date":1537176602,"visible_start_date":1537176602,"end_date":1735669800},"is_direct_submittable":false,"layout":"problem"}
---
<span class="solution-visible-txt">All submissions for this problem are available.</span>###Read problems statements [Hindi](http://www.codechef.com/download/translated/SEPT18/hindi/BSHUFFLE.pdf) ,[Bengali](http://www.codechef.com/download/translated/SEPT18/bengali/BSHUFFLE.pdf) , [Mandarin chinese](http://www.codechef.com/download/translated/SEPT18/mandarin/BSHUFFLE.pdf) , [Russian](http://www.codechef.com/download/translated/SEPT18/russian/BSHUFFLE.pdf) and [Vietnamese](http://www.codechef.com/download/translated/SEPT18/vietnamese/BSHUFFLE.pdf) as well.


Consider the following algorithm, which generates a (not necessarily uniformly) random permutation of numbers $1$ through $N$:

```
P := [1, 2, ..., N]
for i in 1..N do
    j := rand(1, N)
    swap(P[i], P[j])
```

Here, `rand(1, N)` returns a uniformly random integer between $1$ and $N$ inclusive. Let's denote the probability that the permutation generated by this algorithm is $P$ by $p(P)$.

Find a permutation $P_1$ such that $p(P_1)$ is maximum possible and a permutation $P_2$ such that $p(P_2)$ is minimum possible.

### Input
The first and only line of the input contains a single integer $N$.

### Output
Print two lines. The first line should contain $N$ space-separated integers denoting your permutation $P_1$. The second line should contain $N$ space-separated integers denoting your permutation $P_2$.

If there are multiple answers, you may print any one.

### Constraints 
- $1 \le N \le 17$

### Subtasks
**Subtask #1 (20 points):** $1 \le N \le 7$

**Subtask #2 (80 points):** original constraints

### Example Input
```
2
```

### Example Output
```
1 2
2 1
```

### Explanation
There are two possible permutations, $[1, 2]$ and $[2, 1]$. Both are equally likely to appear as the result of the given algorithm, so any pair of permutations is a valid answer.