# Arup Guha
# 2/9/2022
# Quick program to generate input for the permutation problem in CS2 Exam #1.

import random

# Size of permutation.
n = random.randint(10, 50)

# Fill in order.
vals = []
for i in range(1,n+1):
    vals.append(i)

# Randomly swap pairs of items a lot.
for i in range(2000):
    x = random.randint(0, n-1)
    y = random.randint(0, n-1)
    tmp = vals[x]
    vals[x] = vals[y]
    vals[y] = tmp

# Print the permutation without spaces. or commas.
print(n)
for i in range(n):
    print(vals[i], end="")
