output_description: Print all prime numbers p that divide f(x) for every integer x, in ascending
  order.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      a_N
      :
      a_0
attempt: import math
  import copy
  
  
  def trial_division(n):
      factor = []
      tmp = int(math.sqrt(n)) + 1
      for num in range(2, tmp):
          while n % num == 0:
              n //= num
              factor.append(num)
  
      if not factor:
          return set([n])
      else:
          factor.append(n)
          return set(factor)
  
  
  def solve():
      n = int(input())
      a = []
      for i in range(n + 1):
          a.append(int(input()))
  
      primes = trial_division(a[-1])
  
      for e in a[:-1]:
          output = copy.deepcopy(primes)
          for p in primes:
              if p % e != 0:
                  output.remove(p)
          primes = output
      for p in primes:
          print(p)
  
  
  if __name__ == "__main__":
      solve()
  
problem_description: Statement
  
  You are given a polynomial of degree N with integer coefficients:
  f(x)=a_Nx^N+a_{N-1}x^{N-1}+...+a_0. Find all prime numbers p that divide f(x)
  for every integer x.
samples: [{"input": "2\n    7\n    -7\n    14", "output": "2\n    7\n    \n\n2 and 7 divide, for example, f(1)=14 and f(2)=28.\n\n* * *"}, {"input": "3\n    1\n    4\n    1\n    5", "output": "There may be no integers that satisfy the condition.\n\n* * *"}, {"input": "0\n    998244353", "output": "998244353"}]