output_description: Print each permutation in a line in order. Separate adjacency elements by a
  space character.
input_description: An integer $n$ is given in a line.
attempt: import sys
  
  sys.setrecursionlimit(10**8)
  
  n = int(input())
  a = [i for i in range(1, n + 1)]
  
  
  def permute(deep, ans):
      if deep == 0:
          print(ans.strip())
      else:
          for i in a:
              if str(i) not in ans:
                  permute(deep - 1, ans + " " + str(i))
  
  
  permute(n, "")
  
problem_description: Permutation Enumeration
  
  For given an integer $n$, print all permutations of $\\{1, 2, ..., n\\}$ in
  lexicographic order.
samples: [{"input": "2", "output": "1 2\n    2 1"}, {"input": "3", "output": "1 2 3\n    1 3 2\n    2 1 3\n    2 3 1\n    3 1 2\n    3 2 1"}]