n = gets a = gets.split b = gets.split puts 1 p a.permutation(n)