Buggy python submission (verdict: Runtime Error):
from math import gcd

def seachPrimeNum(N):
  max = int(N**0.5)
  seachList = [i for i in range(2,N+1)]
  primeNum = list(range(N+1))
  while seachList[0] <= max:
    tmp = seachList[0]
    tmp2 = list(seachList)
    for i in tmp2:
      if i%tmp == 0:
          primeNum[i]=tmp
          seachList.remove(i)
  return primeNum

def prime_factorize(n, f):
    a = []
    while n % f == 0:
        a.append(f)
        n //= f
    
    if f == 2:
      f=3
    else:
      f+=2
      
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
n = int(input())
a = list(map(int, input().split()))
d = seachPrimeNum(max(a))
dic = {}
g = a[0]

Fixed submission:
from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
  
n = int(input())
a = list(map(int, input().split()))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i])
    for j in tmp:
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")

Buggy python submission (verdict: Runtime Error):
from math import gcd

def seachPrimeNum(N):
  max = int(N**0.5)
  seachList = [i for i in range(2,N+1)]
  primeNum = list(range(N+1))
  while seachList[0] <= max:
    tmp = seachList[0]
    tmp2 = list(seachList)
    for i in tmp2:
      if i%tmp == 0:
          primeNum[i]=tmp
          seachList.remove(i)
  return primeNum

def prime_factorize(n, f):
    a = []
    while n % f == 0:
        a.append(f)
        n //= f
    
    if f == 2:
      f=3
    else:
      f+=2
      
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
n = int(input())
a = list(map(int, input().split()))
d = seachPrimeNum(max(a))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i], d[a[i]])
    for j in set(tmp):
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")
  

Fixed submission:
from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
  
n = int(input())
a = list(map(int, input().split()))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i])
    for j in tmp:
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")

Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
a = list(map(int, input().split()))

lis = {}
lis2= [0]*(10**6+1)
flg1 = True

for i in range(n):
  temp =  make_divisors(a[i])
  for j in temp:
    if j == 1:
      continue
    """
    if not  j in lis:
      lis[j]=1
    else:
      flg1 = False
      lis[j]+=1
      if lis[j]==n:
        print("not coprime")
        quit()
    """
    lis2[j]+=1
    if lis2[j]>1:
      flg1 = False
      if lis2[j]==n:
        print("not coprime")
        quit()
    

if flg1:
  print("pairwise coprime")
else:
  print("setwise coprime")



Fixed submission:
from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
  
n = int(input())
a = list(map(int, input().split()))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i])
    for j in tmp:
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")

Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n = int(input())
a = list(map(int, input().split()))

lis = {}
lis2= [0]*(10**6+1)
flg1 = True

for i in range(n):
  temp =  make_divisors(a[i])
  for j in temp:
    if j == 1:
      continue
    """
    if not  j in lis:
      lis[j]=1
    else:
      flg1 = False
      lis[j]+=1
      if lis[j]==n:
        print("not coprime")
        quit()
    """
    lis2[j]+=1
    if lis2[j]>1:
      flg1 = False
      if lis2[j]==n:
        print("not coprime")
        quit()
    

if flg1:
  print("pairwise coprime")
else:
  print("setwise coprime")



Fixed submission:
from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
  
n = int(input())
a = list(map(int, input().split()))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i])
    for j in tmp:
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")

Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n = int(input())
a = list(map(int, input().split()))

lis = {}
flg1 = True

for i in range(n):
  temp =  make_divisors(a[i])
  for j in temp:
    if j == 1:
      continue
    if not  j in lis:
      lis[j]=1
    else:
      flg1 = False
      lis[j]+=1
      if lis[j]==n:
        print("not coprime")
        quit()
      
if flg1:
  print("pairwise coprime")
else:
  print("setwise coprime")

Fixed submission:
from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
  
n = int(input())
a = list(map(int, input().split()))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i])
    for j in tmp:
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")

Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n = int(input())
a = list(map(int, input().split()))

lis = {}
flg1 = True

for i in range(n):
  temp =  make_divisors(a[i])
  for j in temp:
    if j == 1:
      continue
    if not  j in lis:
      lis[j]=1
    else:
      flg1 = False
      lis[j]+=1
      if lis[j]==n:
        print("not coprime")
        quit()
      
if flg1:
  print("pairwise coprime")
else:
  print("setwise coprime")

Fixed submission:
from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
  
n = int(input())
a = list(map(int, input().split()))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i])
    for j in tmp:
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")

Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n = int(input())
a = list(map(int, input().split()))

lis = {}
flg1 = True
flg2 = True

for i in range(n):
  temp =  make_divisors(a[i])
  for j in temp:
    if j == 1:
      continue
    if not  j in lis:
      lis[j]=1
    else:
      flg1 = False
      lis[j]+=1
      if lis[j]==n:
        flg2 = False
      
if flg1:
  print("pairwise coprime")
elif flg2:
  print("setwise coprime")
else:
  print("not coprime")

Fixed submission:
from math import gcd
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
  
n = int(input())
a = list(map(int, input().split()))
dic = {}
g = a[0]
flg = True
for i in range(n):
  g = gcd(g, a[i])
  if flg:
    tmp = prime_factorize(a[i])
    for j in tmp:
      if j in dic:
        flg = False
      else:
        dic[j]=1
        
if flg:
  print("pairwise coprime")
elif g == 1:
  print("setwise coprime")
else:
  print("not coprime")