Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if(a == 0):
        return b
    return gcd(b % a, a)
def lcm(a, b):
    return (a / gcd(a, b)) * b 
t = int(input())
ans = 1
while(t != 0):
    t -= 1
    n = int(input())
    ans = lcm(ans, n)
print(int(ans))


Fixed submission:

def computeGCD(x, y): 
   while(y):
   		x, y = y, x % y
   return x 
n=int(raw_input())
ar=[]
for i in range(0,n):
	k=int(raw_input())
	ar.append(k)

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/computeGCD(an,ar[x]);
print(an)

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
n = int(input())
res = int(input())
while n > 1:
	x = int(input())
	res = (res * x) / gcd(res, x);
	n -= 1
print(res)

Fixed submission:

def computeGCD(x, y): 
   while(y):
   		x, y = y, x % y
   return x 
n=int(raw_input())
ar=[]
for i in range(0,n):
	k=int(raw_input())
	ar.append(k)

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/computeGCD(an,ar[x]);
print(an)

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
ar=list(map(int,input().split()))

an=ar[0]
for x in range(1,len(ar)):
	an=(an*ar[x])/math.gcd(an,ar[x]);
print(an)

Fixed submission:

def computeGCD(x, y): 
   while(y):
   		x, y = y, x % y
   return x 
n=int(raw_input())
ar=[]
for i in range(0,n):
	k=int(raw_input())
	ar.append(k)

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/computeGCD(an,ar[x]);
print(an)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

# code start
def lcm(a,b):
	return a*b/math.gcd(int(a),int(b))

def main():
	count = int(input())
	i = 0
	temp = 1
	while(i<count):
		i+=1
		num = int(input())
		temp = lcm(temp,num)
	print(int(temp))


if __name__ == '__main__':
    main()

# code end


Fixed submission:

def computeGCD(x, y): 
   while(y):
   		x, y = y, x % y
   return x 
n=int(raw_input())
ar=[]
for i in range(0,n):
	k=int(raw_input())
	ar.append(k)

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/computeGCD(an,ar[x]);
print(an)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(" ''))
print((a-1) * (b-1))


Fixed submission:
from sys import stdin, stdout

def main():
    line = stdin.readline()
    parts = line.split()
    m= int(parts[0])
    n = int(parts[1])
    stdout.write(str((n-1)*(m-1)))

main()
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

ends = []
starts = []
possible = False
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        starts.append([a, b])
    elif b == n:
        ends.append([a, b])

starts.sort(key=lambda x: x[1])
ends.sort(key=lambda x: x[0])

i = 0
j = 0
to = starts[i][1]
fr = ends[j][0]
while i != len(starts) and j != len(ends):
    to = starts[i][1]
    fr = ends[j][0]

    if to == fr:
        possible = True
        break

    if to > fr:
        i += 1
    elif fr > to:
        j += 1

while j != len(ends):
    fr = ends[j][0]
    if to == fr:
        possible = True
        break

    j += 1

while i != len(starts):
    to = starts[i][1]

    if to == fr:
        possible = True
        break

    i += 1

print("POSSIBLE") if possible else print("IMPOSSIBLE")


Fixed submission:
# 10 5
# 1 2
# 1 3
# 1 4
# 8 10
# 1 8

n, m = map(int, input().split())

ends = []
starts = []
possible = False
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        starts.append([a, b])
    elif b == n:
        ends.append([a, b])

starts.sort(key=lambda x: x[1])
ends.sort(key=lambda x: x[0])

if not (starts and ends):
    print("IMPOSSIBLE")
    import sys

    sys.exit()

i = 0
j = 0
while i != len(starts) and j != len(ends):
    to = starts[i][1]
    fr = ends[j][0]

    if to == fr:
        possible = True
        break

    if to < fr:
        i += 1
    elif fr < to:
        j += 1

while j != len(ends):
    fr = ends[j][0]
    if to == fr:
        possible = True
        break
    j += 1

while i != len(starts):
    to = starts[i][1]
    if to == fr:
        possible = True
        break
    i += 1

print("POSSIBLE") if possible else print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if 1<=A and A<=9 and 1<=B and B<=9:
    if (A+B)<=9:
        print(A+B)
    else:
        print("error")

Fixed submission:
A, B = [int(x) for x in input().split(" ")]

ans = A + B

print("error" if ans >= 10 else ans)

Buggy python submission (verdict: Runtime Error):
A, B = [int(x) for x in input().split(" ")]

ans = A + B

printf("error" if ans >=10 else ans)

Fixed submission:
A, B = [int(x) for x in input().split(" ")]

ans = A + B

print("error" if ans >= 10 else ans)

Buggy python submission (verdict: Runtime Error):
A,B=[int(x) for x in input().split(" ")]

ans=A+B

printf("error" if ans >=10 else ans)

Fixed submission:
A, B = [int(x) for x in input().split(" ")]

ans = A + B

print("error" if ans >= 10 else ans)

Buggy python submission (verdict: Runtime Error):
A,B={int(x) for x in input().split(" ")}

ans=A+B

printf("error" if ans >=10 else ans)

Fixed submission:
A, B = [int(x) for x in input().split(" ")]

ans = A + B

print("error" if ans >= 10 else ans)

Buggy python submission (verdict: Runtime Error):
A,B={int(x) for x in input().split(" ")}

ans A+B

printf("error" if ans >=10 else ans)

Fixed submission:
A, B = [int(x) for x in input().split(" ")]

ans = A + B

print("error" if ans >= 10 else ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

def add(n,a,b):
    print((n * b + (a - b)) - (n * a + (b - a)) + 1)
    return (n * b + (a - b)) - (n * a + (b - a)) + 1

add(n,a,b)

Fixed submission:
n,a,b = map(int, input().split())
mi = a*(n-1)+b
ma = b*(n-1)+a
if ma -mi+1 < 0:
    print(0)
    quit()
print(ma-mi+1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())


return (n * b + (a - b)) - (n * a + (b - a)) + 1

Fixed submission:
n,a,b = map(int, input().split())
mi = a*(n-1)+b
ma = b*(n-1)+a
if ma -mi+1 < 0:
    print(0)
    quit()
print(ma-mi+1)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main() {
  string s, t; cin >> s >> t;
  int n = s.length();
  int m = s.length();
  if(n > m) {
    printf("GREATER");
  }
  else if(n < m) {
    printf("LESS");
  }
  else {
    if(s > t) {
      printf("GREATER");
    }
    else if(s < t) {
      printf("LESS");
    }
    else {
      printf("EQUAL");
    }
  }
}

Fixed submission:
a=int(input())
b=int(input())
if a>b :
	print("GREATER")
elif a<b:
	print("LESS")
else :
	print("EQUAL")
Buggy python submission (verdict: Runtime Error):
from sys import stdin

def main():
    global lista
    n = int(stdin.readline())
    lista = [int(x) for x in stdin.readline().strip().split()]

    inx = 0
    inx  = cuenta(inx)
    flag = lista[inx] >= lista[inx+1];
    cont = 0
    tempc = 0
    while(inx < len(lista)-1):
        if flag:
            if(lista[inx] >= lista[inx+1]):
                flag = True
                tempc+=1
            else:
                tempc=0
                cont+=1
                flag = inx < len(lista)-2 and lista[inx+1] >= lista[inx+2];
        else:
            if(lista[inx] <= lista[inx+1]):
                flag = False
                tempc+=1
            else:
                tempc=0
                cont+=1
                flag = inx < len(lista)-2 and lista[inx+1] >= lista[inx+2];
        inx+=1
    print(cont+1)

def cuenta(i):
    while(i < len(lista)-1 and lista[i] == lista[i+1]):
        i+=1
    return i

main()



Fixed submission:
from sys import stdin

def main():
	N = int(stdin.readline().strip())
	array = [int(x) for x in stdin.readline().strip().split()]
	ans,i= 0,0
	while i+1 < N:
		if array[i] < array[i+1]:
			ans+=1
			while i+1 < N and array[i] <= array[i+1]:
				i+=1
			i+=1
		elif array[i] > array[i+1]:
			ans+=1
			while i+1 < N and array[i] >= array[i+1]:
				i+=1
			i+=1
		else:
			i+=1
	if i+1 == N or ans == 0:
		ans+=1
	print(ans)
main()
Buggy python submission (verdict: Runtime Error):
a=int(input("Enter the height a in meters="))
b=int(input("Enter the height b in meters="))
c=int(input("Enter the height c in meters="))
if(1<=a and 1<=b and 1<=c and a<=100 and b<=100 and c<=100):
    if(b-a==c-b):
        print("Yes")
    elif(c-b==b-a):
        print("Yes")
    else:
        print("NO")

Fixed submission:
a,b,c=input().split()

a=int(a)
b=int(b)
c=int(c)

if b-a==c-b:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
for i in range(1,100):
    a=int(input("Enter the height a in meters="))
    b=int(input("Enter the height b in meters="))
    c=int(input("Enter the height c in meters="))
    if(b-a==c-b):
        print("Yes")
        print('Since'+str(b)+ '-' +str(a)+ '=' +str(c)+ '-' +str(b)+ ',this arrangement of poles is beautiful.')
    elif(c-b==b-a):
        print("Yes")
        print('Since'+str(c)+ '-' +str(b)+ '=' +str(b)+ '-' +str(a)+ ',this arrangement of poles is beautiful.')
    else:
        print("NO")
        print('Since'+str(b)+ '-' +str(a)+ '≠' +str(c)+ '-' +str(b)+ ',this arrangement of poles is not beautiful.')


Fixed submission:
a,b,c=input().split()

a=int(a)
b=int(b)
c=int(c)

if b-a==c-b:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
import math
a, b, c = input().split()
d = math.fabs(b-a)
e = math.fabs(c-a)
if d == e:
 print('YES')
else:
 print('NO')

Fixed submission:
a,b,c=input().split()

a=int(a)
b=int(b)
c=int(c)

if b-a==c-b:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
def beautiful:
     a,b,c = input().split()
      if abs(b-a) == abs(c-b):
            print('YES')
      else:
            print('NO')

beautiful()

Fixed submission:
a,b,c=input().split()

a=int(a)
b=int(b)
c=int(c)

if b-a==c-b:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = input()
if a*b > c*d:
    print a*b
elif c*d > a*b:
    print c*d
else:
    print a*b

Fixed submission:
A ,B ,C, D = [int(x) for x in input().strip().split(' ')]
r1 ,r2  =A*B, C*D
if (r1 > r2):
    print(r1)
elif(r2 >r1):
    print(r2)
else:
    print(r1)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
if A*B>=C*D:
  print (A*B)
else:
  print (C*D)

Fixed submission:
A ,B ,C, D = [int(x) for x in input().strip().split(' ')]
r1 ,r2  =A*B, C*D
if (r1 > r2):
    print(r1)
elif(r2 >r1):
    print(r2)
else:
    print(r1)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
n = input().split(' ')
c = 0
K = n[0]
S = n[1]
for i in range(int(K)+1):
    for j in range(int(K)+1):
        for k in range(int(K)+1):
            sum=i+j+k
            if sum is int(S):
                c += 1
                
print(c)

Fixed submission:
k, s = list(map(lambda x: int(x), input().split()))

count = 0
for x in range(k+1):
    for y in range(k+1):
        if x+y+k >= s and x+y <= s:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split(" "))
sum = 0
for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i+j+l == s:
                sum += 1
print(sum)

Fixed submission:
k, s = list(map(lambda x: int(x), input().split()))

count = 0
for x in range(k+1):
    for y in range(k+1):
        if x+y+k >= s and x+y <= s:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
st=input()
print(int(st))
#Stay safe
#IndiaFightsCorona
#FightBack
#StayHome
#StaySafe

Fixed submission:
print eval(raw_input())
# print eval(raw_input())

Buggy python submission (verdict: Runtime Error):
a,op,b = input().split("")
if(op=='+'):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))

Fixed submission:
print eval(raw_input())
# print eval(raw_input())
Buggy python submission (verdict: Runtime Error):
n = int(input()) 
t = list(map(int,input().strip().split()))[:n] 
m = int(input())
p=[]
x=[]
for _ in range(m):
    a,b = map(int,input().split())
    p.append(a)
    x.append(b)
s=sum(t)
for i in range(m):
    s-=t[p[i]-1]
    s+=x[p[i]-1]
    print(s)


Fixed submission:
n = input()
a = map(int, raw_input().split())
s = sum(a)
m = input()
for i in xrange(m):
	p, x = map(int, raw_input().split())
	p -= 1
	print s - a[p] + x
Buggy python submission (verdict: Runtime Error):
ch = input("Enter a character: ")

if(ch=='A' or ch=='a' or ch=='E' or ch =='e' or ch=='I'
 or ch=='i' or ch=='O' or ch=='o' or ch=='U' or ch=='u'):
    print(ch, "is a Vowel")
else:
    print(ch, "is a Consonant")

Fixed submission:
letter = input()
vowels = ['a' , 'e' , 'o' , 'u' , 'i' ]

if letter in vowels:
    print ("vowel")
else:
    print ("consonant")
Buggy python submission (verdict: Runtime Error):
/*
	Suvash Kumar SUMON
	B.Sc. Engineering
	Dept. of Computer Science & Engineering (CSE)
	University of Rajshahi
	suvashsumon@outlook.com
*/

#include<bits/stdc++.h>
#define congrats_bro_you_solved_it return 0;
#define cholo_suru_kora_jak() int main()

using namespace std;

int countDivisibles(long long int A, long long int B, long long int M) 
{ 
    
    if (A % M == 0) 
        return (B / M) - (A / M) + 1; 
  
    
    return (B / M) - (A / M); 
} 

cholo_suru_kora_jak()
{
	long long int a, b, c, count=0;
	cin>>a>>b>>c;
	long long int ans = (b /c) - ((a - 1)  / c);
	//cout<<countDivisibles(a,b,c);
	cout<<ans;
	congrats_bro_you_solved_it;
}

Fixed submission:
a, b, x = map(int, input().split())
c = b // x - a // x
if a  % x == 0:
	c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
c=0
for i in range(a,b+1):
     if i%x==0:
          c+=1
print(c)

Fixed submission:
a, b, x = map(int, input().split())
c = b // x - a // x
if a  % x == 0:
	c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
from collections import counter
n=[]
n=input()
p=counter(n). keys()
print(p)

Fixed submission:
l=map(int,input().split())
ls=[]
for i in l:
     ls.append(i)
k=set(ls)
n=len(k)
print(n)

Buggy python submission (verdict: Runtime Error):
l=list(map(int(input().split()))
n=1
ml=[]
for i in l:
 if i not in ml:
  ml.append(i)
print(len(ml))


Fixed submission:
l=map(int,input().split())
ls=[]
for i in l:
     ls.append(i)
k=set(ls)
n=len(k)
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
msg=input()
while True:
    msg=msg.replace("ST","")
    if msg.count("ST")==0:
        break
print(len(msg))


Fixed submission:
ipt = raw_input()
l = ""
for s in ipt:
    if not l:
        l += s
    elif l[-1]+s == "ST":
        l = l[:-1]
    else:
        l += s
print len(l)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python

s = raw_input()

s1 = []
for x in s:
	if not s1:
		s1.append(x)
		continue
	if x == 'T' and s1[-1] == 'S':
		s1 = s1[:-1]
	else:
		s1.append(x)

print len(s1)


Fixed submission:
ipt = raw_input()
l = ""
for s in ipt:
    if not l:
        l += s
    elif l[-1]+s == "ST":
        l = l[:-1]
    else:
        l += s
print len(l)

Buggy python submission (verdict: Time Limit Exceeded):
s = raw_input()
a = s.replace("ST","")
a2 = a.replace("ST", "")
while len(a) != len(a2):
	a = a2
	a2 = a2.replace("ST", "")
print len(a2)



Fixed submission:
ipt = raw_input()
l = ""
for s in ipt:
    if not l:
        l += s
    elif l[-1]+s == "ST":
        l = l[:-1]
    else:
        l += s
print len(l)

Buggy python submission (verdict: Runtime Error):
s = raw_input()
n = int(raw_input())

head = []
sub = 0

for i, v in enumerate(s):
    if v == 'S':
        head.append(i)

    if v == 'T' and head:
        head.pop(0)
        sub += 2

print(len(s) - sub)

Fixed submission:
ipt = raw_input()
l = ""
for s in ipt:
    if not l:
        l += s
    elif l[-1]+s == "ST":
        l = l[:-1]
    else:
        l += s
print len(l)

Buggy python submission (verdict: Runtime Error):
s = raw_input()
def cal(s):
	a= 0
	for idx in range(len(s)/2):
		if s[2*idx]==s[2*idx +1]:
			continue
		else:
			a = 1
			s = s[2*(idx+1):]
			break

	if a:
		return cal(s)
	else:
		return s

print(len(cal(s)))

Fixed submission:
ipt = raw_input()
l = ""
for s in ipt:
    if not l:
        l += s
    elif l[-1]+s == "ST":
        l = l[:-1]
    else:
        l += s
print len(l)
Buggy python submission (verdict: Runtime Error):
def main():
    for line in sys.stdin:
		s = line
		if (('N' in s) and ('S' in s)) and not (('W' in s) or ('E' in s)):
			print("Yes")
		elif (('W' in s) and ('E' in s)) and not (('N' in s) or ('S' in s)):
			print("Yes")
		elif (('W' in s) and ('E' in s)) and (('N' in s) and ('S' in s)):
			print("Yes")
		else:
			print("No")

Fixed submission:
from sys import stdin

def main():
    M = stdin.readline().strip()
    S,E,N,W=False,False,False,False
    for i in M:
        if i == 'S':
            S = True
        elif i == 'E':
            E = True
        elif i == 'N':
            N = True
        elif i == 'W':
            W = True
    if S == N and E == W:
        print('Yes')
    else:
        print('No')

main()
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

def main():
	N = int(stdin.readline().strip())
	value = [int(x) for x in range(N)]
	i,card = 0,[-1 for x in range(N)]
	while i < N:
		x = int(stdin.readline().strip())
		card[i] = x
		i+=1
	i,ans = 0,0
	while i < N:
		if card[i]>=2:
			ans+=1
			card[i]-=2
		elif  i+1 < N:
			if card[i] == 1 and card[i+1]>=1:
				ans+=1
				card[i]-=1
				card[i+1]-=1
			else:
				i+=1
		else:
			i+=1
	print(ans)
main()

Fixed submission:
from sys import stdin

def main():
	N = int(stdin.readline().strip())
	i,card = 0,[-1 for x in range(N)]
	while i < N:
		x = int(stdin.readline().strip())
		card[i] = x
		i+=1
	i,ans = 0,0
	while i < N:
		if card[i]%2==0:
			ans+= card[i]//2
			card[i] = 0
		else:
			ans+=(card[i]-1)//2
			card[i] = 1
			if i+1 < N and card[i+1] >=1:
				ans+=1
				card[i],card[i+1] = 0, card[i+1]-1
		i+=1
	print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

def main():
	N = int(stdin.readline().strip())
	value = [int(x) for x in range(N)]
	i,card = 0,[-1 for x in range(N)]
	while i < N:
		x = int(stdin.readline().strip())
		card[i] = x
		i+=1
	i,ans = 0,0
	while i < N:
		if card[i]>=2:
			ans+=1
			card[i]-=2
		elif  i+1 < N:
			if card[i] == 1 and card[i+1]>=1:
				ans+=1
				card[i]-=1
				card[i+1]-=1
			else:
				i+=1
		else:
			i+=1
	print(ans)
main()

Fixed submission:
from sys import stdin

def main():
	N = int(stdin.readline().strip())
	i,card = 0,[-1 for x in range(N)]
	while i < N:
		x = int(stdin.readline().strip())
		card[i] = x
		i+=1
	i,ans = 0,0
	while i < N:
		if card[i]%2==0:
			ans+= card[i]//2
			card[i] = 0
		else:
			ans+=(card[i]-1)//2
			card[i] = 1
			if i+1 < N and card[i+1] >=1:
				ans+=1
				card[i],card[i+1] = 0, card[i+1]-1
		i+=1
	print(ans)
main()
Buggy python submission (verdict: Runtime Error):
# cook your dish here
s=input()
m=s.split()
n=int(s[0]);
l=int(s[2]);
list=[]
for i in range(n):
    st=input()
    list.append(st)
list.sort()
for i in list:
    print(i,end="")



Fixed submission:
a,b=map(int,input().split())
S=[input() for i in range(a)]
S.sort()
print("".join(S))
Buggy python submission (verdict: Runtime Error):
#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        tank = []
        while par[x] >= 0:
            tank.append(x)
            x = par[x]
        for elt in tank:
            par[elt] = x
        return x
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)
    
    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]


import sys
input = sys.stdin.readline

n,q = map(int,input().split())

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

for i in range(q):
    t,u,v = map(int,input().split())
    if t == 0:
        unite(u,v)
    elif same(x,y):
        print(1)
    else:
        print(0)

Fixed submission:
#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        tank = []
        while par[x] >= 0:
            tank.append(x)
            x = par[x]
        for elt in tank:
            par[elt] = x
        return x
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)
    
    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]


import sys
input = sys.stdin.readline

n,q = map(int,input().split())

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

for i in range(q):
    t,u,v = map(int,input().split())
    if t == 0:
        unite(u,v)
    elif same(u,v):
        print(1)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
import sys
from math import gcd
input = sys.stdin.buffer.readline

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


def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass

p = primes(1003)

g = a[0]
for e in a:
    g = gcd(g,e)

if g != 1:
    print("not coprime")
else:
    a.sort()
    if a[0] == a[-1] and a[0] == 1:
        print("pairwise coprime")
    else:
        s = set()
        for e in a:
            for d in p:
                if e%d == 0:
                    if d in s:
                        print("setwise coprime")
                        exit()
                    s.add(d)
            s.add(e)
        print("pairwise coprime")


Fixed submission:
import sys
input = sys.stdin.buffer.readline

d,t,s = map(int,input().split())

if t*s >= d:
    print("Yes")
else:
    print("No")