import copy


def permutation(n):
   """Returns a list of all permutation of n integers"""
   if (n == 1):
      result = [[1]]
      return result
   else:
      result = permutation(n-1)
      newresult = []
      for shorterpermutation in result:
         for position in range(0,n):
            newpermutation = copy.deepcopy(shorterpermutation)
            newpermutation.insert(position,n)
            newresult.append(newpermutation)
      return newresult