require 'prime' N=gets.to_i A=gets.split r=-1 A.permutation{|a| x=a.join.to_i if r