SCU 2007 warmup contest 26

F: Common permutation