package main

import (
	"bufio"
	"fmt"
	"os"
)

var in, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()

	var tc, n int
	for fmt.Fscan(in, &tc); tc > 0; tc-- {
		fmt.Fscan(in, &n)
		if n%2 == 1 {
			fmt.Fprintf(out, "1 ")
		}
		for i := n - 2; i >= 2; i-- {
			fmt.Fprintf(out, "%d ", i)
		}
		if n%2 == 0 {
			fmt.Fprintf(out, "1 ")
		}
		fmt.Fprintf(out, "%d %d\n", n-1, n)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type CF1728B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1728B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1728B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1728B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1728B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1728B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1728B
Date: 9/10/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1728/B
Problem: CF1728B
**/
func (in *CF1728B) Run() {

	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 4 {
			fmt.Print("2 1 3 4")
		} else if n == 5 {
			arr := make([]int, n)
			arr[n-1] = n
			arr[n-2] = n - 1
			arr[n-3] = 3
			arr[n-4] = 2
			arr[n-5] = 1
			for i := 0; i < n; i++ {
				fmt.Print(arr[i], " ")
			}
		} else {
			arr := make([]int, n)
			arr[n-1] = n
			arr[n-2] = n - 1
			arr[n-3] = 1
			arr[n-4] = 3
			arr[n-5] = 2
			for i, j := 4, 0; i < n-1; i++ {
				arr[j] = i
				j++
			}
			for i := 0; i < n; i++ {
				fmt.Print(arr[i], " ")
			}
		}
		fmt.Println()
	}

}

func NewCF1728B(r *bufio.Reader) *CF1728B {
	return &CF1728B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1728B(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrInt64(in *bufio.Reader) []int64 {
	numbs := readLineNumbs(in)
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

func main() {
	var t, n int
	in := bufio.NewReader(os.Stdin)
	t = readInt(in)
	for t > 0 {
		t--
		n = readInt(in)
		if n%2 == 0 {

			for i := n - 2; i >= 1; i-- {
				fmt.Printf("%d ", i)
			}
			fmt.Printf("%d %d", n-1, n)
		} else {
			fmt.Print("1 ")
			for i := n - 2; i > 1; i-- {
				fmt.Printf("%d ", i)
			}
			fmt.Printf("%d %d", n-1, n)
		}
		fmt.Println()
	}
}

package main

import "fmt"

func main() {
	CF1728B()
}
func CF1728B() {
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		for j := 1; j <= n; j++ {
			if n&1 == 0 {
				if j < n-1 {
					if j&1 == 0 {
						fmt.Print(j - 1)
					} else {
						fmt.Print(j + 1)
					}
				} else {
					fmt.Print(j)
				}
			} else {
				if j == 1 || j >= n-1 {
					fmt.Print(j)
				} else {
					if j&1 == 0 {
						fmt.Print(j + 1)
					} else {
						fmt.Print(j - 1)
					}
				}
			}
			if j == n {
				fmt.Println("")
			} else {
				fmt.Print(" ")
			}
		}
	}
}
func CF1728A() {
	var t int
	fmt.Scan(&t)
	for t != 0 {
		t--
		var n int
		fmt.Scan(&n)
		var m int
		var mi int
		var i int = 1
		for n != 0 {
			n--
			var ai int
			fmt.Scan(&ai)
			if ai > m {
				m = ai
				mi = i
			}
			i++
		}
		fmt.Println(mi)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)

		aa := make([]int, n)
		for i := 0; i < n; i++ {
			aa[i] = i + 1
		}
		var x int
		for i := 0; i < n-2; i++ {
			if x < aa[i] {
				x += aa[i]
			} else {
				x = 0
			}
		}

		if x > 0 {
			aa[0], aa[n-3] = n-2, 1
		}
		x = 0
		for _, v := range aa {
			if x < v {
				x += v
			} else {
				x = 0
			}
			fmt.Fprintf(out, "%d ", v)
		}
		fmt.Fprintln(out)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func value(arr []int) int {
	x := 0
	for _, z := range arr {
		if x < z {
			x += z
		} else {
			x = 0
		}
	}
	return x
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	nrTests, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < nrTests; i++ {
		scanner.Scan()
		nr, _ := strconv.Atoi(scanner.Text())
		if nr%2 == 0 {
			for i := nr - 2; i >= 1; i-- {
				fmt.Print(i, " ")
			}
		} else {
			for i := nr - 2; i >= 4; i-- {
				fmt.Print(i, " ")
			}
			for i := 1; i <= 3; i++ {
				fmt.Print(i, " ")
			}
		}
		fmt.Print(nr-1, " ")
		fmt.Println(nr)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var in = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(in, &n)
		for i := n - 3; i > 1; i-- {
			fmt.Print(i, " ")
		}
		fmt.Print(n-2, 1, n-1, n)
		fmt.Println()
	}
}

package main

import "fmt"

func main() {
	var t, n int
	fmt.Scan(&t)
	for t > 0 {
		t--
		fmt.Scan(&n)
		if n&1 == 1 {
			// 3 2 1 4 5 6 7
			for i := n-4; i >= 2; i-- {
				fmt.Printf("%d ", i)
			}
			fmt.Printf("1 %d %d %d %d\n", n-3, n-2, n-1, n)
		} else {
			for i := n-2; i >= 1; i-- {
				fmt.Printf("%d ", i)
			}
			fmt.Printf("%d %d\n", n-1, n)
		}
		// 1 0 1 0 1 0 n 是偶数的是可以的
		// n 是奇数的，把 1 2 留出来喽
		// 1 n-3 n-2 n-1 n
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var (
	reader = bufio.NewReader(os.Stdin)
	t, n   int
)

func solve(n int) string {
	var r []int
	if n%2 == 0 {
		for i := n - 2; i > 0; i-- {
			r = append(r, i)
		}
	} else {
		for i := n - 5; i > 0; i-- {
			r = append(r, i)
		}
		r = append(r, n-4)
		r = append(r, n-3)
		r = append(r, n-2)
	}
	r = append(r, n-1)
	r = append(r, n)
	return strings.Trim(fmt.Sprint(r), "[]")
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n)
		fmt.Println(solve(n))
	}
}

package main

import "fmt"

func main() {
	var t, n int
	fmt.Scan(&t)

	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		if n == 2 {
			fmt.Println("2 1 3")
			continue
		}
		for j := 1; j <= n; j++ {
			if j < n-1 {
				if n%2 == 0 {
					fmt.Printf("%d ", n-1-j)
				} else {
					if j <= 3 {
						fmt.Printf("%d ", j)
					} else {
						fmt.Printf("%d ", n-j+2)
					}
				}
			} else {
				fmt.Printf("%d ", j)
			}
		}
		fmt.Println()
	}
}

package main
// github.com/jamesgrimard/codeforces
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		if n & 1 == 0 { // even
			for j:=n-2;j>=1;j--{
				fmt.Fprintf(out,"%v ",j)
			}
			fmt.Fprintf(out,"%v %v",n-1,n)
		} else {
			fmt.Fprintf(out,"%v ",1)
			for j:=n-2;j>=2;j--{
				fmt.Fprintf(out,"%v ",j)
			}
			fmt.Fprintf(out,"%v %v",n-1,n)
		}
		fmt.Fprintln(out)
	}
}

// format: 0,n-1,n
// 1,7,6,5,4,3,2,8,9
// 1,5,4,3,2,6,7
// 4,5,3,6,2,7,1,8,9

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	s.Scan()
	num, _ := strconv.Atoi(s.Text())

	for i := 0;i < num;i++ {
		s.Scan()
		n, _ := strconv.Atoi(s.Text())

		if n % 2 == 0 {
			for j := n - 2;j > 0;j-- {
				fmt.Printf("%d ", j)
			}
			fmt.Printf("%d %d\n", n - 1, n)
		} else {
			if n == 5 {
				fmt.Printf("1 2 3 4 5\n")
			} else {
				for j := n - 2;j > 3;j-- {
					fmt.Printf("%d ", j)
				}
				fmt.Printf("2 3 1 %d %d\n", n - 1, n)
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

func scan(a ...interface{}) {
	fmt.Fscan(in, a...)
}
func printf(f string, a ...interface{}) {
	fmt.Fprintf(out, f, a...)
}
func solve() {
	var n int
	scan(&n)
	if n%2 == 0 {
		for i := 2; i+2 <= n; i += 2 {
			printf("%d %d ", i, i-1)
		}
		printf("%d %d\n", n-1, n)
	} else {
		printf("1 ")
		for i := 2; i+2 <= n; i += 2 {
			printf("%d %d ", i+1, i)
		}
		printf("%d %d\n", n-1, n)
	}
}
func main() {
	defer out.Flush()
	n := 0
	scan(&n)
	for i := 0; i < n; i++ {
		solve()
	}
}

package main

import (
    "fmt"
)

func main() {
    var t int
    fmt.Scan(&t)
    for t != 0  {
        t--
        var n int
        fmt.Scan(&n)
        if n == 1 {
            fmt.Println("1")
            continue
        } else if n == 2 {
            fmt.Println("1 2")
            continue
        } else if n == 3 {
            fmt.Println("2 1 3")
            continue
        }
        a := make([]int, n)
        cur := 0
        if n % 2 != 0 {
            a[0] = 1
            a[1] = 2
            a[2] = 3
            cur = 3
        }
        for ;cur < n - 2; cur = cur + 2 {
            a[cur] = cur + 2
            a[cur + 1] = cur + 1
        }
        a[cur] = cur + 1
        a[cur + 1] = cur + 2
        for _, e := range a {
            fmt.Printf("%d ", e)
        }
        fmt.Printf("\n")
    }
}

// https://codeforces.com/contest/1728/problem/B
package main

import "fmt"

func main() {
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		a := make([]int, n)
		for j := 0; j < n; j++ {
			a[j] = j + 1
		}
		for t := n & 1; t < n-2; t += 2 {
			temp := a[t]
			a[t] = a[t+1]
			a[t+1] = temp
		}
		for j := 0; j < n; j++ {
			fmt.Printf("%d ", a[j])
		}
		fmt.Printf("\n")
	}
}

package main

import (
	"fmt"
)

const N = 2e2
const inf = 1e9

func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		t--
		var n int
		fmt.Scan(&n)
		var a [N]int
		a[n-2] = n - 1
		a[n-1] = n
		if n&1 > 0 {
			a[0] = 1
			a[1] = 2
			a[2] = 3
			for i := 3; i < n-2; i += 2 {
				a[i] = i + 2
				a[i+1] = i + 1
			}
		} else {
			for i := 0; i < n-2; i += 2 {
				a[i] = i + 2
				a[i+1] = i + 1
			}
		}
		for i := 0; i < n; i++ {
			fmt.Print(a[i], " ")
		}
		fmt.Println()
	}
}

package main

import (
	"fmt"
	"os"
)

func solve() {
	n := readInt()
	if n%2 == 0 {
		for i := 1; i+2 <= n; i += 2 {
			fmt.Print(i+1, i, " ")
		}
		fmt.Println(n-1, n)
	} else {
		fmt.Print("1 2 3 ")
		for i := 4; i+2 < n; i += 2 {
			fmt.Print(i+1, i, " ")
		}
		fmt.Println(n-1, n)
	}
}

func main() {
	t := readInt()

	for i := 0; i < t; i++ {
		solve()
	}
}

func readInt() int {
	var x int
	fmt.Fscan(os.Stdin, &x)
	return x
}

func iota(a []int, start int) {
	for i := 0; i < len(a); i++ {
		a[i] = start
		start++
	}
}

func next_permutation(a []int) bool {
	n := len(a)
	pos := n - 2
	for ; pos >= 0; pos-- {
		if a[pos] < a[pos+1] {
			break
		}
	}
	if pos == -1 {
		return false
	}
	for i := n - 1; i >= 0; i-- {
		if a[i] > a[pos] {
			a[i], a[pos] = a[pos], a[i]
			reverse(a[pos+1 : n])
			break
		}
	}
	return true
}

func reverse(a []int) {
	n := len(a)
	for i := 0; i < n/2; i++ {
		a[i], a[n-i-1] = a[n-i-1], a[i]
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	input := bufio.NewReader(os.Stdin)
	data, _, _ := input.ReadLine()
	numOfTestCases, _ := strconv.Atoi(string(data))
	nums := make([]int, numOfTestCases)
	// each testcase
	for i := 0; i < numOfTestCases; i++ {
		data, _, _ = input.ReadLine()
		nums[i], _ = strconv.Atoi(string(data))
	}
	// start
	for i := 0; i < numOfTestCases; i++ {
		length := nums[i]
		// 确定最后2个数最大
		ans := make([]int, length)
		ans[length - 1] = length
		ans[length - 2] = length - 1
		// 保证前面的数算出的x为0
		// 前3位cancel掉
		if length & 1 == 1 {
			ans[0] = 1
			ans[1] = 2
			ans[2] = 3
			for j := 3; j < length - 2; j+=2 {
				ans[j], ans[j+1] = j+2, j+1
			}
		} else {
			for j := 0; j < length - 2; j+=2 {
				ans[j], ans[j+1] = j+2, j+1
			}
		}
		for _, num := range ans {
			fmt.Printf("%d ", num)
		}
		fmt.Println()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var a [200005]int

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in, &t)
	for cs := 0; cs < t; cs++ {
		var n int
		fmt.Fscan(in, &n)
		for i := 1; i <= n; i++ {
			a[i] = i
		}
		if n % 3 != 2 {
			a[n - 3], a[n - 2] = a[n - 2], a[n - 3]
		}
		if n % 3 == 0 {
			a[n - 4], a[n - 5] = a[n - 5], a[n - 4]
		}
		for i := 1; i < n; i++ {
			fmt.Fprintf(out, "%d ", a[i])
		}
		fmt.Fprintln(out, a[n])
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type CF1728B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1728B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1728B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1728B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1728B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1728B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1728B
Date: 9/10/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1728/B
Problem: CF1728B
**/
func (in *CF1728B) Run() {

	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 4 {
			fmt.Print("2 1 3 4")
		} else if n == 5 {
			arr := make([]int, n)
			arr[n-1] = n
			arr[n-2] = n - 1
			arr[n-3] = 1
			arr[n-4] = 2
			arr[n-5] = 3
			for i := 0; i < n; i++ {
				fmt.Print(arr[i], " ")
			}
		} else {
			arr := make([]int, n)
			arr[n-1] = n
			arr[n-2] = n - 1
			arr[n-3] = 1
			arr[n-4] = 3
			arr[n-5] = 2
			for i, j := 4, 0; i < n-1; i++ {
				arr[j] = i
				j++
			}
			for i := 0; i < n; i++ {
				fmt.Print(arr[i], " ")
			}
		}
		fmt.Println()
	}

}

func NewCF1728B(r *bufio.Reader) *CF1728B {
	return &CF1728B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1728B(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type CF1728B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1728B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1728B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1728B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1728B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1728B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1728B
Date: 9/10/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1728/B
Problem: CF1728B
**/
func (in *CF1728B) Run() {

	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 4 {
			fmt.Print("2 1 3 4")
		} else if n == 5 {
			arr := make([]int, n)
			arr[n-1] = n
			arr[n-2] = n - 1
			arr[n-3] = 1
			arr[n-4] = 2
			arr[n-5] = 2
			for i := 0; i < n; i++ {
				fmt.Print(arr[i], " ")
			}
		} else {
			arr := make([]int, n)
			arr[n-1] = n
			arr[n-2] = n - 1
			arr[n-3] = 1
			arr[n-4] = 3
			arr[n-5] = 2
			for i, j := 4, 0; i < n-1; i++ {
				arr[j] = i
				j++
			}
			for i := 0; i < n; i++ {
				fmt.Print(arr[i], " ")
			}
		}
		fmt.Println()
	}

}

func NewCF1728B(r *bufio.Reader) *CF1728B {
	return &CF1728B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1728B(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type CF1728B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1728B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1728B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1728B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1728B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1728B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1728B
Date: 9/10/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1728/B
Problem: CF1728B
**/
func (in *CF1728B) Run() {

	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()

		if n%2 == 0 {
			for i := n - 2; i >= 1; i-- {
				fmt.Print(i, " ")
			}
			fmt.Println(n-1, n)
		} else {
			for i := 0; i < n; i++ {
				fmt.Print(i+1, " ")
			}
			fmt.Println()
		}
	}

}

func NewCF1728B(r *bufio.Reader) *CF1728B {
	return &CF1728B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1728B(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type CF1728B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1728B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1728B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1728B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1728B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1728B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1728B
Date: 9/10/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1728/B
Problem: CF1728B
**/
func (in *CF1728B) Run() {

	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		for i := n - 2; i >= 1; i-- {
			fmt.Print(i, " ")
		}
		fmt.Println(n-1, n)
	}

}

func NewCF1728B(r *bufio.Reader) *CF1728B {
	return &CF1728B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1728B(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type CF1728B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1728B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1728B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1728B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1728B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1728B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1728B
Date: 9/10/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1728/B
Problem: CF1728B
**/
func (in *CF1728B) Run() {

	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		for i := 2; i <= n-2; i++ {
			fmt.Print(i, " ")
		}
		fmt.Println(1, n-1, n)
	}

}

func NewCF1728B(r *bufio.Reader) *CF1728B {
	return &CF1728B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1728B(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrInt64(in *bufio.Reader) []int64 {
	numbs := readLineNumbs(in)
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

func main() {
	var t, n int
	in := bufio.NewReader(os.Stdin)
	t = readInt(in)
	for t > 0 {
		t--
		n = readInt(in)
		if n%2 == 0 {

			for i := n - 2; i >= 1; i-- {
				fmt.Printf("%d ", i)
			}
			fmt.Printf("%d %d", n-1, n)
		} else {
			for i := 1; i <= n; i++ {
				fmt.Printf("%d ", i)
			}
		}
		fmt.Println()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrInt64(in *bufio.Reader) []int64 {
	numbs := readLineNumbs(in)
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

func main() {
	var t, n int
	in := bufio.NewReader(os.Stdin)
	t = readInt(in)
	for t > 0 {
		t--
		n = readInt(in)
		if n%2 == 0 {
			fmt.Print("2 1 ")
			for i := 3; i <= n; i++ {
				fmt.Printf("%d ", i)
			}
		} else {
			for i := n - 2; i >= 1; i-- {
				fmt.Printf("%d ", i)
			}
			fmt.Printf("%d %d", n-1, n-2)
		}
		fmt.Println()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

func readArrInt64(in *bufio.Reader) []int64 {
	numbs := readLineNumbs(in)
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

func main() {
	var t, n int
	in := bufio.NewReader(os.Stdin)
	t = readInt(in)
	for t > 0 {
		t--
		n = readInt(in)
		if n%2 == 0 {
			fmt.Print("2 1 ")
			for i := 3; i <= n; i++ {
				fmt.Printf("%d ", i)
			}
		} else {
			for i := 1; i <= n; i++ {
				fmt.Printf("%d ", i)
			}
		}
		fmt.Println()
	}
}

package main

import "fmt"

func main() {
	CF1728B()
}
func CF1728B() {
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		for j := 1; j <= n; j++ {
			if n&1 == 0 {
				if j == n-3 {
					fmt.Print(j + 1)
				} else if j == n-2 {
					fmt.Print(j - 1)
				} else {
					fmt.Print(j)
				}
			} else {
				fmt.Print(j)
			}
			if j == n {
				fmt.Println("")
			} else {
				fmt.Print(" ")
			}
		}
	}
}
func CF1728A() {
	var t int
	fmt.Scan(&t)
	for t != 0 {
		t--
		var n int
		fmt.Scan(&n)
		var m int
		var mi int
		var i int = 1
		for n != 0 {
			n--
			var ai int
			fmt.Scan(&ai)
			if ai > m {
				m = ai
				mi = i
			}
			i++
		}
		fmt.Println(mi)
	}
}

package main

import "fmt"

func main() {
	CF1728B()
}
func CF1728B() {
	res := make(map[int]string, 97)
	res[4] = "2 1 3 4"
	res[5] = "1 2 3 4 5"
	for i := 6; i <= 100; i++ {
		res[i] = res[i-2] + " " + string(i+48-1) + " " + string(i+48)
	}
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		if r, ok := res[n]; ok {
			fmt.Println(r)
		} else {

		}
	}
}
func CF1728A() {
	var t int
	fmt.Scan(&t)
	for t != 0 {
		t--
		var n int
		fmt.Scan(&n)
		var m int
		var mi int
		var i int = 1
		for n != 0 {
			n--
			var ai int
			fmt.Scan(&ai)
			if ai > m {
				m = ai
				mi = i
			}
			i++
		}
		fmt.Println(mi)
	}
}

package main

import "fmt"

func main() {
	CF1728B()
}
func CF1728B() {
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		for j := 1; j <= n; j++ {
			fmt.Print(j)
			if j == n {
				fmt.Println("")
			} else {
				fmt.Print(" ")
			}
		}
	}
}
func CF1728A() {
	var t int
	fmt.Scan(&t)
	for t != 0 {
		t--
		var n int
		fmt.Scan(&n)
		var m int
		var mi int
		var i int = 1
		for n != 0 {
			n--
			var ai int
			fmt.Scan(&ai)
			if ai > m {
				m = ai
				mi = i
			}
			i++
		}
		fmt.Println(mi)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)

		aa := make([]int, n)
		for i := 0; i < n; i++ {
			aa[i] = i + 1
		}

		var x int
		for i := 0; i < n-2; i++ {
			if x < aa[i] {
				x += aa[i]
			} else {
				x = 0
			}
		}

		if x != 0 {
			aa[n-3], aa[n-4] = aa[n-4], aa[n-3]
		}
		for _, v := range aa {
			fmt.Fprintf(out, "%d ", v)
		}
		fmt.Fprintln(out)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)

		fmt.Fprintf(out, "%d %d 1 ", n-1, n)
		for i := 2; i <= n-2; i++ {
			fmt.Fprintf(out, "%d ", i)
		}
		fmt.Fprintln(out)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)

		for i := 2; i <= n-2; i++ {
			fmt.Fprintf(out, "%d ", i)
		}
		fmt.Fprintf(out, "1 %d %d\n", n-1, n)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	nrTests, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < nrTests; i++ {
		scanner.Scan()
		nr, _ := strconv.Atoi(scanner.Text())
		for i := nr - 2; i >= 1; i-- {
			fmt.Print(i, " ")
		}
		fmt.Print(nr-1, " ")
		fmt.Println(nr)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	nrTests, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < nrTests; i++ {
		scanner.Scan()
		nr, _ := strconv.Atoi(scanner.Text())
		for i := nr - 2; i >= 1; i-- {
			fmt.Print(i, " ")
		}
		fmt.Print(nr-1, " ")
		fmt.Print(nr)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var in = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(in, &n)
		for i := n - 3; i > 1; i-- {
			print(i, " ")
		}
		fmt.Print(n-2, 1, n-1, n)
		println()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var in = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		var n int
		fmt.Fscan(in, &n)
		tmp := make([]int, n, n)
		for i := 1; i <= n; i++ {
			tmp[i-1] = i
		}
		var ret []int
		for i := n - 2; i > 1; i-- {
			if tmp[i]+tmp[i-1] > tmp[n-1] {
				// move to first
				ret = append(ret, tmp[i])
				tmp[i] = -1
			}
		}
		for _, v := range tmp {
			if v != -1 {
				ret = append(ret, v)
			}
		}
		for _, v := range ret {
			fmt.Print(v, " ")
		}
		fmt.Println()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var in, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()

	var tc, n int
	for fmt.Fscan(in, &tc); tc > 0; tc-- {
		fmt.Fscan(in, &n)
		for i := 2; i <= n-2; i++ {
			fmt.Printf("%d ", i)
		}
		fmt.Printf("%d %d %d", 1, n-1, n)
		fmt.Println()
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var in, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()

	var tc, n int
	for fmt.Fscan(in, &tc); tc > 0; tc-- {
		fmt.Fscan(in, &n)
		for i := 1; i <= n; i++ {
			fmt.Printf("%d ", i)
		}
		fmt.Println()
	}
}

package main

import "fmt"

func main() {
	var t, n int
	fmt.Scan(&t)
	for t > 0 {
		t--
		fmt.Scan(&n)
		for i := n-2; i >= 1; i-- {
			fmt.Printf("%d ", i)
		}
		fmt.Printf("%d %d\n", n-1, n)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var (
	reader = bufio.NewReader(os.Stdin)
	t, n   int
)

func solve(n int) string {
	var r []int
	for i := n - 2; i > 0; i-- {
		r = append(r, i)
	}
	r = append(r, n-1)
	r = append(r, n)
	return strings.Trim(fmt.Sprint(r), "[]")
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n)
		fmt.Println(solve(n))
	}
}

package main

import "fmt"

func main() {
	var t, n int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		fmt.Scan(&n)
		for j := 1; j <= n; j++ {
			if j < n-1 {
				fmt.Printf("%d ", n-1-j)
			} else {
				fmt.Printf("%d ", j)
			}
		}
		fmt.Println()
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

//arr := strings.Split(strings.TrimSpace(line), " ")
//for i := range arr {
//tmp, _ := strconv.Atoi(arr[i])
//intArr = append(intArr, tmp)
//}

func main() {
	var line string
	var testcount, testcount2 int //, testcount2, i, j int
	var tmp int
	var intArr []int
	var maxSs, minSe, minPe, maxPs int
	minSe = 1000000001
	minPe = 1000000001
	fmt.Scanf("%d\n", &testcount)
	reader := bufio.NewReader(os.Stdin)
	for i := 0; i < testcount; i++ {
		line, _ = reader.ReadString('\n')
		arr := strings.Split(strings.TrimSpace(line), " ")
		for j := range arr {
			tmp, _ = strconv.Atoi(arr[j])
			intArr = append(intArr, tmp)
		}
		if i == testcount-1 {
			line, _ = reader.ReadString('\n')
			arr = strings.Split(strings.TrimSpace(line), " ")
			for j := range arr {
				tmp, _ = strconv.Atoi(arr[j])
				testcount2 = tmp
			}
		}
	}
	for i := 0; i < testcount2; i++ {
		line, _ = reader.ReadString('\n')
		arr := strings.Split(strings.TrimSpace(line), " ")
		for j := range arr {
			tmp, _ = strconv.Atoi(arr[j])
			intArr = append(intArr, tmp)
		}
	}
	//	var maxSs, minSe, minPe, maxPs int
	for i := 0; i < testcount*2; i++ {
		if i%2 == 0 {
			if intArr[i] > maxSs {
				maxSs = intArr[i]
			}
		} else {
			if intArr[i] < minSe {
				minSe = intArr[i]
			}
		}
	}
	for i := testcount * 2; i < (testcount*2 + testcount2*2); i++ {
		if i%2 == 0 {
			if intArr[i] > maxPs {
				maxPs = intArr[i]
			}
		} else {
			if intArr[i] < minPe {
				minPe = intArr[i]
			}
		}
	}
	if (maxSs-minPe > 0) && (maxSs-minPe) > (maxPs-minSe) {
		fmt.Println(maxSs - minPe)
	} else if (maxPs-minSe > 0) && (maxPs-minSe) > (maxSs-minPe) {
		fmt.Println(maxPs - minSe)
	} else {
		fmt.Println(0)
	}
}

package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

type Tuple struct {
	l, r int
}

func main() {
	sc := NewScanner()
	N := sc.NextInt()
	lrmn := int(1e9)
	llmx := 0
	for i := 0; i < N; i++ {
		l := Tuple{sc.NextInt(), sc.NextInt()}
		if lrmn > l.r {
			lrmn = l.r
		}
		if llmx < l.l {
			llmx = l.l
		}
	}

	M := sc.NextInt()
	ans := 0
	for i := 0; i < M; i++ {
		r := Tuple{sc.NextInt(), sc.NextInt()}
		dist := 0

		if r.r < llmx {
			dist = llmx - r.r
		} else if lrmn < r.l {
			dist = r.l - lrmn
		}
		if ans < dist {
			ans = dist
		}

	}
	fmt.Println(ans)

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"regexp"
	"strconv"
	"strings"
)

func main() {
	var n [2]int
	var lrs [2][2][]int

	reader := bufio.NewReader(os.Stdin)
	re := regexp.MustCompile(`\r?\n`)

	for k := 0; k < 2; k++ {
		if s, err := reader.ReadString('\n'); err != nil {
			if err != io.EOF {
				return
			}
		} else {
			n[k], err = strconv.Atoi(re.ReplaceAllString(s, ""))
			if err != nil {
				return
			}
		}

		lrs[k][0] = make([]int, n[k])
		lrs[k][1] = make([]int, n[k])
		for i := 0; i < n[k]; i++ {
			if _in, err := reader.ReadString('\n'); err != nil {
				if err == io.EOF {
					break
				} else {
					return
				}
			} else {
				lr := strings.Split(re.ReplaceAllString(_in, ""), " ")
				if len(lr) != 2 {
					return
				}
				for j := 0; j < 2; j++ {
					lrs[k][j][i], err = strconv.Atoi(re.ReplaceAllString(lr[j], ""))
					if err != nil {
						return
					}
				}
			}
		}
	}

	merge_sort(lrs[0][0], 0, n[0]-1)
	merge_sort(lrs[0][1], 0, n[0]-1)
	merge_sort(lrs[1][0], 0, n[1]-1)
	merge_sort(lrs[1][1], 0, n[1]-1)

	diff := max(lrs[1][0][n[1]-1]-lrs[0][1][0], lrs[0][0][n[0]-1]-lrs[1][1][0])
	if diff > 0 {
		fmt.Println(diff)
	} else {
		fmt.Println(0)
	}
}

func max(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func merge(buffer []int, start, middle, end int) {
	sorted := make([]int, end-start+1)

	i := start
	j := middle + 1
	k := 0
	for i <= middle && j <= end {
		if buffer[i] <= buffer[j] {
			sorted[k] = buffer[i]
			i++
		} else {
			sorted[k] = buffer[j]
			j++
		}
		k++
	}
	for i <= middle {
		sorted[k] = buffer[i]
		k++
		i++
	}
	for j <= end {
		sorted[k] = buffer[j]
		k++
		j++
	}

	i = start
	k = 0
	for i <= end {
		buffer[i] = sorted[k]
		i++
		k++
	}
}

func merge_sort(buffer []int, start, end int) {
	if end > start {
		middle := (end + start) / 2
		merge_sort(buffer, start, middle)
		merge_sort(buffer, middle+1, end)
		merge(buffer, start, middle, end)
	}
}

// Codeforces 785 B Anton and Classes
package main

import (
	"bufio"
	"fmt"
	"strings"
	"strconv"
	"os"
	"sort"
)
var in *bufio.Reader

func readFive() (int,int,int,int,int) {
	var a [5]int
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("first read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for i:=0; i<len(ss); i++ {
		a[i], err = strconv.Atoi(ss[i])
		if err != nil {
			fmt.Println("n atoi failure", err)
			panic(err)
		}
	}
	return a[0],a[1],a[2],a[3],a[4]
}

func readLineNumbs(n int) []int {
	a := make([]int, n)
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for j:=0; j<n; j++ {
		aa,err := strconv.Atoi(ss[j])
		if err != nil {
			fmt.Println("aa conv failed", err)
			panic(err)
		}
		a[j] = aa
	}
	return a
}

var n,m int
var l1,r1,l2,r2 []int
var dist int

func readData() {
	in = bufio.NewReader(os.Stdin)
	n,_,_,_,_ = readFive()
	l1 = make([]int, n)
	r1 = make([]int, n)
	for i:=0; i<n; i++ {
		l1[i],r1[i],_,_,_ = readFive()
	}
	m,_,_,_,_ = readFive()
	l2 = make([]int, m)
	r2 = make([]int, m)
	for i:=0; i<m; i++ {
		l2[i],r2[i],_,_,_ = readFive()
	}
}

func solve() {
	dist = 0
	sort.Ints(l1)
	sort.Ints(r1)
	sort.Ints(l2)
	sort.Ints(r2)
	// check dist for r1 < l2
	d12 := l2[m-1]-r1[0]
	if dist < d12 {
		dist = d12
	}
	d21 := l1[n-1]-r2[0]
	if dist < d21 {
		dist = d21
	}
}

func printRes() {
	fmt.Println(dist)
}

func main() {
	readData()
	solve()
	printRes()
}


package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1316C(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int) {
		in.Scan()
		for _, b := range in.Bytes() {
			x = x*10 + int(b-'0')
		}
		return
	}

	n, m, p := read(), read(), read()
	a := make([]int, n)
	for i := range a {
		a[i] = read()
	}
	b := make([]int, m)
	for i := range b {
		b[i] = read()
	}

	i, j := 0, 0
	for a[i]%p == 0 {
		i++
	}
	for b[j]%p == 0 {
		j++
	}
	Fprint(out, i+j)
}

func main() { CF1316C(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1316C(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int) {
		in.Scan()
		for _, b := range in.Bytes() {
			x = x*10 + int(b-'0')
		}
		return
	}

	n, m, p, x, y := read(), read(), read(), 0, 0
	for i := 0; i < n; i++ {
		if read()%p > 0 {
			x = i
		}
	}
	for i := 0; i < m; i++ {
		if read()%p > 0 {
			y = i
		}
	}
	Fprint(out, x+y)
}

func main() { CF1316C(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1316C(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int) {
		in.Scan()
		for _, b := range in.Bytes() {
			x = x*10 + int(b-'0')
		}
		return
	}

	n, m, p, x, y := read(), read(), read(), 0, 0
	a := make([]int, n)
	for i := range a {
		a[i] = read()
		if a[i]%p > 0 {
			x = i
		}
	}
	b := make([]int, m)
	for i := range b {
		b[i] = read()
		if b[i]%p > 0 {
			y = i
		}
	}
	Fprint(out, x+y)
}

func main() { CF1316C(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"sync"
)

var a [1000005]int
var b [1000005]int

func main() {
	n := ReadInt()
	m := ReadInt()
	p := ReadInt()
	for i := 0; i < n; i++ {
		a[i] = ReadInt() % p
	}
	for i := 0; i < m; i++ {
		b[i] = ReadInt() % p
	}
	x := 0
	y := 0
	for a[x] == 0 {
		x++
	}
	for b[y] == 0 {
		y++
	}
	fmt.Println(x + y)
}

////////////////////////////////////

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

var out chan string
var in *bufio.Scanner
var outWg *sync.WaitGroup

func ReadString() string {
	in.Scan()
	return in.Text()
}
func ReadStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ReadString()
	}
	return s
}
func ReadInt() int {
	intStr := ReadString()
	i, _ := strconv.ParseInt(intStr, 10, 32)
	return int(i)
}
func ReadIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ReadInt()
	}
	return arr
}
func init() {
	//set input
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(2e+5))
	in.Split(bufio.ScanWords)

	//set output
	out = make(chan string, 16)
	outWg = &sync.WaitGroup{}
	outWg.Add(1)

	writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
	go func(write *bufio.Writer) {
		defer outWg.Done()
		defer write.Flush()

		for line := range out {
			write.WriteString(line + "\n")
		}
	}(writer)
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var reader io.Reader
var scanner *bufio.Scanner

func Init(io io.Reader, max_token_size int) {
	reader = bufio.NewReader(io)
	scanner = bufio.NewScanner(reader)
	// max token size
	scanner.Split(bufio.ScanWords)
	scanner.Buffer([]byte{}, max_token_size)
}

func stderr(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
}

func die(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
	os.Exit(1)
}

func NextInt() int {
	bytes := NextBytes()
	i, err := Atoi(bytes)
	if err != nil {
		die(err)
	}
	return i
}
func NextInt64() int64 {
	bytes := NextBytes()
	i, err := Atoi64(bytes)
	if err != nil {
		die(err)
	}
	return i
}

func NextBytes() []byte {
	if !scanner.Scan() {
		die(scanner.Err())
	}
	bytes := scanner.Bytes()
	copied := make([]byte, len(bytes))
	copy(copied, bytes)
	return copied
}

func Atoi(b []byte) (int, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func Atoi64(b []byte) (int64, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	var n int64
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int64(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func ExtendByteArray(a []byte, size int) []byte {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]byte, size-len(a))...)
	}
}

func ExtendIntArray(a []int, size int) []int {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]int, size-len(a))...)
	}
}

func reverseInts(a []int) {
	for l, r := 0, len(a)-1; l < r; l, r = l+1, r-1 {
		a[l], a[r] = a[r], a[l]
	}
}

func unique(a []int) int {
	newLen := 0
	n := len(a)
	for i := 0; i < n; i++ {
		if newLen == 0 || a[i] != a[newLen-1] {
			a[newLen] = a[i]
			newLen++
		}
	}
	return newLen
}

func main() {
	inf := os.Stdin
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	// inf, err := os.Open("a.in")
	// if err != nil {
	// 	die(err)
	// }
	// out, err := os.Create("a.out")
	// if err != nil {
	// 	die(err)
	// }
	// defer out.Close()
	Init(inf, 1000010)

	n := NextInt()
	m := NextInt()
	p := NextInt()
	// a := list.New()
	// b := list.New()
	a := make([]int, n)
	b := make([]int, m)
	for i := 0; i < n; i++ {
		a[i] = NextInt()
	}
	for i := 0; i < m; i++ {
		b[i] = NextInt()
	}

	l, r := 0, 0
	for l < n && r < m {
		if a[l]%p == 0 {
			l++
			continue
		}
		if b[r]%p == 0 {
			r++
			continue
		}
		break
	}
	fmt.Fprintln(out, l+r)
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

const maxCapacity = 1024 * 1024 * 10

var scanner *bufio.Scanner
var writer *bufio.Writer

func ioPrepare() {
	scanner = bufio.NewScanner(os.Stdin)
	writer = bufio.NewWriter(os.Stdout)

	buf := make([]byte, maxCapacity)
	scanner.Buffer(buf, maxCapacity)
}

func solve() {
	var n, m, p int
	scanner.Scan()
	fmt.Sscan(scanner.Text(), &n, &m, &p)
	ans := 0
	scanner.Scan()
	aStr := strings.Split(scanner.Text(), " ")
	for i, v := range aStr {
		a, _ := strconv.Atoi(v)
		if a%p != 0 {
			ans += i
			break
		}
	}
	scanner.Scan()
	bStr := strings.Split(scanner.Text(), " ")
	for i, v := range bStr {
		b, _ := strconv.Atoi(v)
		if b%p != 0 {
			ans += i
			break
		}
	}

	outputStr := fmt.Sprintf("%d\n", ans)
	writer.WriteString(outputStr)
}

func main() {
	ioPrepare()
	solve()
	writer.Flush()
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1316C(_r io.Reader, _w io.Writer) {
	in := bufio.NewScanner(_r)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	read := func() (x int) {
		in.Scan()
		for _, b := range in.Bytes() {
			x = x*10 + int(b-'0')
		}
		return
	}

	n, m, p, x, y := read(), read(), read(), 0, 0
	for i := 0; i < n; i++ {
		if read()%p > 0 {
			x = i
		}
	}
	for i := 0; i < m; i++ {
		if read()%p > 0 {
			y = i
			break
		}
	}
	Fprint(out, x+y)
}

func main() { CF1316C(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"sync"
)

var a [1000005]int
var b [1000005]int

func main() {
	n := ReadInt()
	m := ReadInt()
	p := ReadInt()
	for i := 0; i < n; i++ {
		a[i] = ReadInt()
		a[i] %= p
	}
	for i := 0; i < m; i++ {
		b[i] = ReadInt()
		b[i] %= p
	}
	x := 0
	y := 0
	if a[x] == 0 {
		x++
	}
	if b[y] == 0 {
		y++
	}
	fmt.Println(x + y)
}

////////////////////////////////////

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

var out chan string
var in *bufio.Scanner
var outWg *sync.WaitGroup

func ReadString() string {
	in.Scan()
	return in.Text()
}
func ReadStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ReadString()
	}
	return s
}
func ReadInt() int {
	intStr := ReadString()
	i, _ := strconv.ParseInt(intStr, 10, 32)
	return int(i)
}
func ReadIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ReadInt()
	}
	return arr
}
func init() {
	//set input
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(2e+5))
	in.Split(bufio.ScanWords)

	//set output
	out = make(chan string, 16)
	outWg = &sync.WaitGroup{}
	outWg.Add(1)

	writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
	go func(write *bufio.Writer) {
		defer outWg.Done()
		defer write.Flush()

		for line := range out {
			write.WriteString(line + "\n")
		}
	}(writer)
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"sync"
)

var a [1000005]int
var b [1000005]int

func main() {
	n := ReadInt()
	m := ReadInt()
	p := ReadInt()
	for i := 0; i < n; i++ {
		a[i] = ReadInt() % p
	}
	for i := 0; i < m; i++ {
		b[i] = ReadInt() % p
	}
	x := 0
	y := 0
	if a[x] == 0 {
		x++
	}
	if b[y] == 0 {
		y++
	}
	fmt.Println(x + y)
}

////////////////////////////////////

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

var out chan string
var in *bufio.Scanner
var outWg *sync.WaitGroup

func ReadString() string {
	in.Scan()
	return in.Text()
}
func ReadStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ReadString()
	}
	return s
}
func ReadInt() int {
	intStr := ReadString()
	i, _ := strconv.ParseInt(intStr, 10, 32)
	return int(i)
}
func ReadIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ReadInt()
	}
	return arr
}
func init() {
	//set input
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(2e+5))
	in.Split(bufio.ScanWords)

	//set output
	out = make(chan string, 16)
	outWg = &sync.WaitGroup{}
	outWg.Add(1)

	writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
	go func(write *bufio.Writer) {
		defer outWg.Done()
		defer write.Flush()

		for line := range out {
			write.WriteString(line + "\n")
		}
	}(writer)
}


package main

import (
	"bufio"
	"os"
	"fmt"
	"math"
)
var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
func readLine()(string,error) 			{ return reader.ReadString('\n') }

func main() {
	defer writer.Flush()
	var n,m,t int
	scanf("%d %d\n", &n,&m)
	n1 := 0
	m1 := 0
	for i := 0; i < n ; i++ {
		scanf("%d" , &t)
		if t%2 == 0 {
			n1++
		}
	}
	scanf("\n")
	for i := 0; i < m ; i++ {
		scanf("%d" , &t)
		if t%2 == 0 {
			m1++
		}
	}

	fmt.Println(int64(math.Min(float64(n1), float64(m - m1)) + math.Min(float64(m1),float64(n - n1))))
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func print(a ...interface{})            { fmt.Fprint(writer, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }
func scan(a ...interface{})             { fmt.Fscan(reader, a...) }

func main() {
	defer writer.Flush() // STDOUT MUST BE FLUSHED MANUALLY!!!
	var n, m int
	scan(&n, &m)
	var par, impar []int

	for i := 0; i < n; i++ {
		num := 0
		scan(&num)
		if num%2 == 0 {
			par = append(par, num)
		} else {
			impar = append(impar, num)
		}
	}

	cnt := 0

	for i := 0; i < m; i++ {
		num := 0
		scan(&num)

		if num%2 == 0 && len(impar) > 0 {
			impar = impar[:len(impar)-1]
			cnt++
			continue
		}

		if num%2 != 0 && len(par) > 0 {
			par = par[:len(par)-1]
			cnt++
			continue
		}
	}
	print(cnt)
	print("\n")
}

package main
import (
	"bufio"
	"fmt"
	"os"
)

func main(){
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	n,m,tmp := 0,0,0
	fmt.Fscanf(in, "%d %d\n", &n, &m)
	odd1, odd2, even1, even2 := 0,0,0,0
	for i:= 0; i<n; i++ {
		fmt.Fscanf(in, "%d", &tmp)
		if tmp%2==0 {
			even1++
		} else{
			odd1++
		}
	}
	fmt.Fscanf(in, "\n")
	for i:= 0; i<m; i++ {
		fmt.Fscanf(in, "%d", &tmp)
		if tmp%2==0 {
			even2++
		} else{
			odd2++
		}
	}
	z := min(odd1,even2) + min(odd2, even1)
	fmt.Fprintf(out, "%d\n", z)
	return
}

func min(a,b int) int {
	if a<b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	n, m := 0, 0
	fmt.Fscanf(in, "%d %d\n", &n, &m)
	odd1, odd2, even1, even2 := 0, 0, 0, 0
	for i := 0; i < n; i++ {
		tmp := 0
		fmt.Fscanf(in, "%d", &tmp)
		if tmp%2 == 0 {
			even1++
		} else {
			odd1++
		}
	}
	fmt.Fscanf(in, "\n")
	for i := 0; i < m; i++ {
		tmp := 0
		fmt.Fscanf(in, "%d", &tmp)
		if tmp%2 == 0 {
			even2++
		} else {
			odd2++
		}
	}
	//fmt.Println(odd1, odd2, even1, even2)
	ans := min(odd1, even2) + min(odd2, even1)
	fmt.Fprintf(out, "%d\n", ans)
	return
}
func minstep(a, b byte) int {
	return min(int(a-b+26)%26, int(b-a+26)%26)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	"os"
	"fmt"
	"math"
)
var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
func readLine()(string,error) 			{ return reader.ReadString('\n') }

func main() {
	defer writer.Flush()
	var n,m,t int
	scanf("%d %d\n", &n,&m)
	n1 := 0
	m1 := 0
	for i := 0; i < n ; i++ {
		scanf("%d" , &t)
		fmt.Println(t)
		if t%2 == 0 {
			n1++
		}
	}
	scanf("\n")
	for i := 0; i < m ; i++ {
		scanf("%d" , &t)
		fmt.Println(t)
		if t%2 == 0 {
			m1++
		}
	}

	fmt.Println(int64(math.Min(float64(n1), float64(m - m1)) + math.Min(float64(m1),float64(n - n1))))
}

package main

import (
	"bufio"
	"os"
	"fmt"
	"math"
)
var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
func readLine()(string,error) 			{ return reader.ReadString('\n') }

func main() {
	defer writer.Flush()
	var n,m,t int
	scanf("%d %d", &n,&m)
	n1 := 0
	m1 := 0
	for i := 0; i < n ; i++ {
		scanf("%d" , &t)
		if t%2 == 0 {
			n1++
		}
	}
	for i := 0; i < m ; i++ {
		scanf("%d" , &t)
		if t%2 == 0 {
			m1++
		}
	}

	fmt.Println(int64(math.Min(float64(n1), float64(m - m1)) + math.Min(float64(m1),float64(n - n1))))
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	var m, a, b float64
	var ret float64 = math.MaxFloat64
	fmt.Scan(&n, &m)
	for i:=0; i < n; i++ {
		fmt.Scan(&a, &b)
		if x := a/b; x < ret {
			ret = x;
		}
	}
	fmt.Println(ret*m)
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := NewScanner()
	N, M := sc.NextInt(), float64(sc.NextInt())
	mx := 0.0
	for i := 0; i < N; i++ {
		a, b := float64(sc.NextInt()), float64(sc.NextInt())
		if mx > M/b*a || mx == 0.0 {
			mx = M / b * a
		}
	}
	fmt.Println(mx)

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	var n, m int
	var a, b, minA, minB float64
	stdin := bufio.NewReader(os.Stdin)
	fmt.Fscanf(stdin, "%d %d\n", &n, &m)
	fmt.Fscanf(stdin, "%f %f\n", &minA, &minB)
	for i := 1; i < n; i++ {
		fmt.Fscanf(stdin, "%f %f\n", &a, &b)
		if (minA / minB) > (a / b) {
			minA, minB = a, b
		}
	}
	fmt.Println(float64(m) * minA / minB)
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os"
	"strconv"
)

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func minll(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func maxll(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()
	n := readi()
	m := readi()
	ma := readi()
	mb := readi()
	for i := 1; i < n; i++ {
		a := readi()
		b := readi()
		if a*mb < ma*b {
			ma = a
			mb = b
		}
	}
	printf("%.8f\n", float64(ma*m)/float64(mb))

}

package main

import "fmt"
import "math"

func main() {
    var n,d int
    fmt.Scan(&n, &d)

    var minPrice float64 = math.MaxFloat64
    for i:=0; i<n; i++ {
        var a, b int
        fmt.Scan(&a, &b)
        p := float64(a) / float64(b)
        if p*float64(d) < minPrice {
            minPrice = p*float64(d)
        }
    }
    fmt.Print(minPrice)
}

package main

import "fmt"

func main() {
    var n,d int
    fmt.Scan(&n, &d)

    var minPrice float64
    for i:=0; i<n; i++ {
        var a, b int
        fmt.Scan(&a, &b)
        p := float64(a) / float64(b)
        if p*float64(d) < minPrice {
            minPrice = p*float64(d)
        }
    }
    fmt.Print(minPrice)
}


package main

import (
	"bufio"
	"bytes"
	"container/heap"
	"fmt"
	"io"
	"os"
)

func main() {
	defer out.Flush()
	n := in.NextInt()
	t := make([]int, n)
	for i := range t {
		t[i] = in.NextInt() - 1
	}
	ans := make([]int, n)
	pq := NewPriorityQueue()
	items := make([]*Item, n)
	for j := range items {
		items[j] = new(Item)
		items[j].index = j
		pq.Push(items[j])
	}
	for i := 0; i < n; i++ {
		for L := 1; i+L <= n; L++ {
			items[t[i+L-1]].count++
			pq.Update(items[t[i+L-1]].heapIndex)
			ans[pq.Top().index]++
		}
		for j := range items {
			items[j].count = 0
		}
	}
	for i := range ans {
		if i != 0 {
			fmt.Fprint(out, " ")
		}
		fmt.Fprint(out, ans[i])
	}
	fmt.Fprintln(out)
}

type Item struct {
	index     int
	count     int
	heapIndex int
}

func (a *Item) Less(b *Item) bool {
	if a.count != b.count {
		return a.count > b.count
	}
	return a.index < b.index
}

type PriorityQueue struct {
	heap pqHeap
}

func NewPriorityQueue() *PriorityQueue {
	pq := new(PriorityQueue)
	heap.Init(&pq.heap)
	return pq
}

func (pq *PriorityQueue) Push(item *Item) {
	heap.Push(&pq.heap, item)
}

func (pq *PriorityQueue) Pop() *Item {
	return heap.Pop(&pq.heap).(*Item)
}

func (pq *PriorityQueue) Remove(index int) *Item {
	return heap.Remove(&pq.heap, index).(*Item)
}

func (pq *PriorityQueue) Update(index int) {
	heap.Fix(&pq.heap, index)
}

func (pq *PriorityQueue) Top() *Item {
	return pq.heap[0]
}

func (pq *PriorityQueue) Len() int {
	return len(pq.heap)
}

type pqHeap []*Item

func (h pqHeap) Less(i, j int) bool {
	return h[i].Less(h[j])
}

func (h pqHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
	h[i].heapIndex = i
	h[j].heapIndex = j
}

func (h pqHeap) Len() int {
	return len(h)
}

func (h *pqHeap) Push(x interface{}) {
	item := x.(*Item)
	item.heapIndex = len(*h)
	*h = append(*h, item)
}

func (h *pqHeap) Pop() interface{} {
	old := *h
	n := len(old)
	item := old[n-1]
	item.heapIndex = -1
	*h = old[:n-1]
	return item
}

var (
	in  = NewFastReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

type FastReader struct {
	r   *bufio.Reader
	buf string
}

func NewFastReader(r io.Reader) *FastReader {
	return &FastReader{
		r: bufio.NewReader(r),
	}
}

func (r *FastReader) advance() {
	for len(r.buf) != 0 && r.buf[0] == ' ' {
		r.buf = r.buf[1:]
	}
	var err error
	for len(r.buf) == 0 && err != io.EOF {
		buf := new(bytes.Buffer)
		for {
			var chunk []byte
			var more bool
			chunk, more, err = r.r.ReadLine()
			buf.Write(chunk)
			if !more {
				break
			}
		}
		r.buf = buf.String()
	}
}

func (r *FastReader) NextLine() string {
	r.advance()
	line := r.buf
	r.buf = ""
	return line
}

func (r *FastReader) NextWord() string {
	r.advance()
	var word string
	wordStart := 0
	for i := 0; i < len(r.buf); i++ {
		b := r.buf[i]
		if b == ' ' {
			if i != wordStart {
				word = r.buf[wordStart:i]
				r.buf = r.buf[i:]
				break
			}
			wordStart = i + 1
		}
	}
	if len(word) == 0 {
		word = r.buf
		r.buf = ""
	}
	return word
}

func (r *FastReader) NextInt() int {
	return parseInt(r.NextWord())
}

func parseInt(word string) int {
	sign := 1
	if word[0] == '-' {
		sign = -1
		word = word[1:]
	}
	result := 0
	for i := 0; i < len(word); i++ {
		result = result*10 + int(word[i]) - '0'
	}
	result *= sign
	return result
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextLong() int64 {
	i, err := strconv.ParseInt(io.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextDouble() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntLn(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func (io *Io) PrintStringLn(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func intMin(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func intMax(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	io := NewIo()
	defer io.Flush()
	N := io.NextInt()
	A := make([]int, N)
	for i := 0; i < N; i++ {
		A[i] = io.NextInt() - 1
	}
	C := make([]int, N)
	for i := 0; i < N; i++ {
		D := make([]int, N)
		D[A[i]]++
		argmax := A[i]
		C[argmax]++
		for j := i + 1; j < N; j++ {
			D[A[j]]++
			if D[argmax] < D[A[j]] || (D[argmax] == D[A[j]] && argmax > A[j]) {
				argmax = A[j]
			}
			C[argmax]++
		}
	}
	io.PrintIntLn(C)
}


package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func(Case int) {
		var n int
		Fscan(in, &n)
		Fprint(out, n)
		for i := 1; i < n; i++ {
			Fprint(out, " ",i)
		}
		Fprintln(out, )
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}
}

func main() { run(os.Stdin, os.Stdout) }

package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	var it, i int64
	t, _ := strconv.ParseInt(sc.Text(), 10, 64)
	for it=1; it<=t; it++ {
		sc.Scan()
		n, _ := strconv.ParseInt(sc.Text(), 10,64)
		fmt.Printf("%d ", n);
		for i=2; i<=n; i++ {
			fmt.Printf("%d ", i-1)
		}
		fmt.Printf("\n")
	}
}

package main

import (
	"fmt"
	"bufio"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func solve() {
	var n int
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		printf("%d ", (i + 1) % n + 1)
	}
	printf("\n");
}

func main() {
	defer writer.Flush()
	var t int
	scanf("%d\n", &t)
	for ; t > 0; t-- {
		solve()
	}
}

package main
import (
    "fmt"
    "os"
    "bufio"

)
var in = bufio.NewReader(os.Stdin)
func main() {
    testCases := 0
    fmt.Fscan(in,&testCases)
    for i := 0; i < testCases; i++ {
        n := 0
        fmt.Fscan(in,&n)
        for i:= 2; i <= n;i++ {
            fmt.Print(i," ");
        }
        fmt.Println(1)
    }
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"math/rand"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func(Case int) {
		var n int
		Fscan(in, &n)
		a := make([]int, n)
		for i := range a {
			a[i] = i
		}
	o:
		for {
			rand.Shuffle(n, func(i, j int) { a[i], a[j] = a[j], a[i] })
			for i, v := range a {
				if v == i {
					continue o
				}
			}
			break
		}
		for _, v := range a {
			Fprint(out, v+1, " ")
		}
		Fprintln(out)
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}
}

func main() { run(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner *bufio.Scanner
var writer *bufio.Writer

func getInt64() int64 {
	scanner.Scan()
	x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return x
}

func getInt() int {
	scanner.Scan()
	x, _ := strconv.Atoi(scanner.Text())
	return x
}

func getFloat() float64 {
	scanner.Scan()
	x, _ := strconv.ParseFloat(scanner.Text(), 64)
	return x
}

func getString() string {
	scanner.Scan()
	return scanner.Text()
}

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	for i := getInt(); i > 0; i-- {
		sol()
	}
}

func sol() {
	var arr []int
	n := getInt()
	for i := 0; i < n; i++ {
		arr = append(arr, n-i)
	}
	if n%2 == 1 {
		arr[(n / 2)] = 1
		arr[n-1] = (n / 2) + 1
	}
	ans := fmt.Sprintf("%v", arr)
	ans = ans[1 : len(ans)-1]
	writer.WriteString(ans + "\n")
}

package main
import (
	"bufio"
	"fmt"
	"os"
)
var rd = bufio.NewReader(os.Stdin)
func main() {
	q := 0
	fmt.Fscan(rd, &q)
	for t := 0; t < q; t++ {
		n := 0
		fmt.Fscan(rd, &n)
		for i := 2; i <= n; i++ {
			fmt.Print(i, " ")
		}
		fmt.Println(1)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	in := bufio.NewReader(os.Stdin)

	var t, n int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		result := ""
		for i := 2; i <= n; i++ {
			result += strconv.Itoa(i) + " "
		}
		result += "1"
		fmt.Println(result)
	}
}

package main

import(

	"fmt"
	."fmt"
	"bufio"
	"os"
)

func solve(n int){
	for i:=0;i<n;i++{
		if i<n-1{
			fmt.Printf("%v ",i+2)
		}else{
			fmt.Printf("1")
		}
	}
	fmt.Println()
}

func main(){
	var TESTS int
	in := bufio.NewReader(os.Stdin)

	Fscan(in,&TESTS)

	for ;TESTS>0;TESTS--{
		var n int
		Fscan(in,&n)
		solve(n)
	}
}

package main

import (
	"fmt"
	"strings"
)

func main() {

	// get T
	var T int
	fmt.Scanf("%d\n", &T)

	// range over problems
	for t := 0; t < T; t++ {

		// get N
		var N int
		fmt.Scanf("%d\n", &N)

		// solve
		s := solve(N)
		fmt.Println(strings.Join(s, " "))
	}
}

func solve(N int) []string {

	// generate an array
	arr := make([]string, N)
	arr[0] = fmt.Sprint(N)
	for n := 1; n < N; n++ {
		arr[n] = fmt.Sprint(n)
	}

	return arr
}

package main
import (
    "fmt"
    "os"
    "bufio"

)
var in = bufio.NewReader(os.Stdin)
func main() {
    testCases := 0
    fmt.Fscan(in,&testCases)
    for i := 0; i < testCases; i++ {
        n := 0
        fmt.Fscan(in,&n)
        for i:= 2; i < n;i++ {
            fmt.Print(i," ");
        }
        fmt.Println(1)
    }
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner *bufio.Scanner
var writer *bufio.Writer

func getInt64() int64 {
	scanner.Scan()
	x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return x
}

func getInt() int {
	scanner.Scan()
	x, _ := strconv.Atoi(scanner.Text())
	return x
}

func getFloat() float64 {
	scanner.Scan()
	x, _ := strconv.ParseFloat(scanner.Text(), 64)
	return x
}

func getString() string {
	scanner.Scan()
	return scanner.Text()
}

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	sol()
}

func sol() {
	var arr []int
	n := getInt()
	for i := 0; i < n; i++ {
		arr = append(arr, n-i)
	}
	if n%2 == 1 {
		arr[(n / 2)] = 1
		arr[n-1] = (n / 2) + 1
	}
	ans := fmt.Sprintf("%v\n", arr)
	ans = ans[1 : len(ans)-2]
	writer.WriteString(ans)
}