Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()
List = ["Sunny", "Cloudy", "Rainy"]
res = 0
for i in range(3):
  if S == List[i]:
    res = i+1
if res == 2:
  res = 0
print(List[res])

Fixed submission:
S = input()
List = ["Sunny", "Cloudy", "Rainy"]
res = 0
for i in range(3):
  if S == List[i]:
    res = i+1
if res == 3:
  res = 0
print(List[res])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
res = 0
for i in range(1,N+1):
  if i == N:
    res += 0
  else:
    res += i%(i+1)
print(res)

Fixed submission:
N=int(input())
n=N-1
res = n*(n+1)//2
print(res)
Buggy python submission (verdict: Runtime Error):
N=int(input)
List = list(map(int, input().split()))
mid = -1
flag = True
for i in range(N):
  if List[i] == i+1:
    pass
  else:
    flag = False
    if mid == -1:
      mid = List[i]
    else:
      if mid == List[i]:
        print("YES")
      else:
        print("NO")
if flag:
  print("YES")

Fixed submission:
N=int(input())
List = list(map(int, input().split()))
flag = 0
for i in range(N):
  if List[i] == i+1:
    pass
  else:
    flag += 1
if flag==2 or flag == 0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
s = input()
flag = False
for i in range(3):
  if List[i] == List[i+1]:
    flag = True
if flag:
  print("Bad")
else:
  print("Good")
  

Fixed submission:
s =input()
flag = False
for i in range(3):
  if s[i] == s[i+1]:
    flag = True
if flag:
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>x:
    return True
  else:
    return False
    
for i in range(N+1):
  height += List[i]
  res +=1
  if checkF(height,X):
    res = res-1
    break
print(res)

Fixed submission:
N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>x:
    return True
  else:
    return False
    
for i in range(N):
  height += List[i]
  res +=1
  if checkF(height,X):
    res = res-1
    break
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
List = []
for i in range (M):
  List.append(list(map(int, input().split())))
resList = [1]*N
for i in range(M):
  if List[i][0] > 1:
    for j in range(0,List[i][0]-1):
      if resList[j] == 1:
        resList[j] = 0
  if List[i][1] < N:
    for k in range(List[i][1],N):
      if resList[k] == 1:
        resList[k] = 0
print(resList.count(1))

Fixed submission:
N,M=map(int,input().split())
List = []
for i in range (M):
  List.append(list(map(int, input().split())))
resList = [0]*N
for i in range(M):
  resList[List[i][0]-1] +=1
  if List[i][1]<N:
    resList[List[i][1]] +=-1
for j in range(1,N):
  resList[j] = resList[j] + resList[j-1]
print(resList.count(M))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
List = []
for i in range (M):
  List.append(list(map(int, input().split())))
resList = [0]*N
for i in range(M):
  l = List[i][0]
  r = List[i][1]
  for j in range(l,r+1):
    resList[j-1] += 1
print(resList.count(M))

Fixed submission:
N,M=map(int,input().split())
List = []
for i in range (M):
  List.append(list(map(int, input().split())))
resList = [0]*N
for i in range(M):
  resList[List[i][0]-1] +=1
  if List[i][1]<N:
    resList[List[i][1]] +=-1
for j in range(1,N):
  resList[j] = resList[j] + resList[j-1]
print(resList.count(M))
Buggy python submission (verdict: Runtime Error):
S = input()
mydict = {"A":"T","T":"A","G":"C","c":"G"}
print(mydict[S])

Fixed submission:
S = input()
mydict = {"A":"T","T":"A","G":"C","C":"G"}
print(mydict[S])
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
check = 0
res = 0
for i in range(100):
  if A % i == 0 and B % i == 0:
    check += 1
    if check == K:
      res = i
      break
print(res)

Fixed submission:
A,B,K=map(int,input().split())
check = 0
res = 0
for i in range(100,0,-1):
  if A % i == 0 and B % i == 0:
    check += 1
    if check == K:
      res = i
      break
print(res)
Buggy python submission (verdict: Runtime Error):
S=input()
List = list(S)
zeroNum = List.count("0")
oneNum = List.count("1")
res = min(reroNum,oneNum)
print(res*2)

Fixed submission:
S=input()
List = list(S)
zeroNum = List.count("0")
oneNum = List.count("1")
res = min(zeroNum,oneNum)
print(res*2)
Buggy python submission (verdict: Runtime Error):
s = input()
m = int(s[5:7])
if m <=4:
  print("Heisei")
else:
  prit("TBD")

Fixed submission:
s = input()
m = int(s[5:7])
if m <=4:
  print("Heisei")
else:
  print("TBD")
Buggy python submission (verdict: Runtime Error):
Row = int(input())
List = []
for i in range (Row):
  List.append(list(map(str, input().split())))
res = 0
for i in range(Row):
  if List[i][1] = "JPY":
    res += int(List[i][0])
  else:
    res += int(List[i][0])*380000
print(res)

Fixed submission:
Row = int(input())
List = []
for i in range (Row):
  List.append(list(map(str, input().split())))
res = 0
for i in range(Row):
  if List[i][1] == "JPY":
    res += float(List[i][0])
  else:
    res += float(List[i][0])*380000
print(res)
Buggy python submission (verdict: Runtime Error):
N,M,X,Y=map(int,input().split())
ListX = list(map(int, input().split()))
ListY = list(map(int, input().split()))
ListX.sort()
ListX.sort()
threX = max(X,List[N-1])
threY = min(Y,List[0])
Z = threX+1
if threY >= Z:
  print("No War")
else:
  print("War")
  

Fixed submission:
N,M,X,Y=map(int,input().split())
ListX = list(map(int, input().split()))
ListY = list(map(int, input().split()))
ListX.sort()
ListY.sort()
threX = max(X,ListX[N-1])
threY = min(Y,ListY[0])
Z = threX+1
if threY >= Z:
  print("No War")
else:
  print("War")
Buggy python submission (verdict: Runtime Error):
Row = int(input())
flag = True
List = []
for i in range (Row):
  List.append(int(input()))
s_l = set(List)
if len(List) != len(s_l):
  print("No")
for i in range(Row-1):
  n = len(List[i])-1
  if List[i][n] != List[i+1][0]:
    flag = False
if flag:
  print("Yes")
else:
  print("No")

Fixed submission:
Row = int(input())
flag = True
List = []
for i in range (Row):
  List.append(input())
s_l = set(List)
if len(List) != len(s_l):
  print("No")
else:
  for i in range(Row-1):
    n = len(List[i])-1
    if List[i][n] != List[i+1][0]:
      flag = False
  if flag:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
if x2 >= x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
elif x2 < x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
elif x2 < x1 and y1 >= y2:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
else:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
print(x3,y3,x4,y4)

Fixed submission:
x1,y1,x2,y2=map(int,input().split())
if x2 >= x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
elif x2 < x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
elif x2 < x1 and y1 >= y2:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
else:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
print(x3,y3,x4,y4)

Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2=map(int,input().split())
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
for i in range(-1000,1000):
  if Dist*(i-x2)**2==Dist*(y2-y1)**2:
    if i < x2:
      x3 = i
      y3 = y2 - (x2-x1)*(x3-x2)//(y2-y1)
  if Dist*(i-x1)**2==Dist*(y2-y1)**2:
    if i < x1:
      x4 = i
      y4 = y1 - (x2-x1)*(x4-x1)//(y2-y1)
print(x3,y3,x4,y4)

Fixed submission:
x1,y1,x2,y2=map(int,input().split())
if x2 >= x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
elif x2 < x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
elif x2 < x1 and y1 >= y2:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
else:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
print(x3,y3,x4,y4)
Buggy python submission (verdict: Runtime Error):
S=input()
a=int(input())
List=list(S)
res = 1
for i in range(a):
  if List[i] != "1":
    res = List[i]
print(res)

Fixed submission:
S=input()
a=int(input())
List=list(S)
res = 1
for i in range(a):
  if List[i] != "1":
    res = List[i]
    break
print(res)
Buggy python submission (verdict: Runtime Error):
S = input()
flag = True
count = 0
if not S[0] == "A":
  flag = False
for i in range(2,len(S)-1):
  if S[i] == "C":
    count += 1
  else:
    if not S[len(S)].islower():
      flag = False 
if not S[len(S)].islower():
  flag = False
if not count == 1:
  flag = False
if flag:
  print("AC")
else:
  print("WA")

Fixed submission:
S = input()
flag = True
count = 0
if not S[0] == "A":
  flag = False
for i in range(2,len(S)-1):
  if S[i] == "C":
    count += 1
  else:
    if not S[i].islower():
      flag = False
if not S[1].islower():
  flag = False
if not S[len(S)-1].islower():
  flag = False
if not count == 1:
  flag = False
if flag:
  print("AC")
else:
  print("WA")
Buggy python submission (verdict: Runtime Error):
N = int(input())
List = list(map(int, input().split()))
mid = 0
res = 0
for i in range(N):
  for j range(i+1,N):
    mid = abs(List[i]-List[j])
    res = max(res,mid)
print(res)

Fixed submission:
N = int(input())
List = list(map(int, input().split()))
mid = 0
res = 0
for i in range(N):
  for j in range(i+1,N):
    mid = abs(List[i]-List[j])
    res = max(res,mid)
print(res)

Buggy python submission (verdict: Runtime Error):
N = int(input())
List = list(map(int, input().split()))
mid = 0
res = 0
for i in range(N):
  for i range(i+1,N):
    mid = abs(List[i]-List[j])
    res = max(res,mid)
print(res)

Fixed submission:
N = int(input())
List = list(map(int, input().split()))
mid = 0
res = 0
for i in range(N):
  for j in range(i+1,N):
    mid = abs(List[i]-List[j])
    res = max(res,mid)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
n = N
flag = True
S = 0
a = 0
while flag:
  a = n % 10
  S +=a
  n = n -a //10
  if n == 0:
    flag =False
if N % S == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
n = N
flag = True
S = 0
a = 0
while flag:
  a = n % 10
  S +=a
  n = (n -a) //10
  if n == 0:
    flag =False
if N % S == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
List = list(map(int, input().split()))
res = 0
flagWhile = True
flagManip = True
while flagWhile:
  for i in range(N):
    if flagManip:
      if List[i] % 2 == 0:
        List[i] = List[i] //2
        flagManip = False
        pass
    List[i] = List[i] * 3
  if flagManip:
    flagWhile = False
  flagManip = True
  if flagWhile:
    res += 1
print(res)

Fixed submission:
N=int(input())
List = list(map(int, input().split()))
res = 0
flagWhile = True
flagManip = True
for i in range(N):
  while List[i] % 2 == 0:
    List[i] = List[i] //2
    res += 1

print(res)
Buggy python submission (verdict: Runtime Error):
List = list(map(int, input().split()))
List.sort()
res = List[2]-List[1]
Litt[1] = List[2]
List[0] += res
mid = List[2] - List[0]
if mid % 2 == 1:
  res += mid //2 +1
else:
  res += mid //2
print(res)

Fixed submission:
List = list(map(int, input().split()))
List.sort()
res = List[2]-List[1]
List[1] = List[2]
List[0] += res
mid = List[2] - List[0]
if mid % 2 == 1:
  res += mid // 2 +2
else:
  res += mid //2
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
List = list(map(int, input().split()))
s_l = set(List)
if len(s_l) == 3:
  print("Three")
else:
  print("Four")

Fixed submission:
N = int(input())
List = list(map(str, input().split()))
s_l = set(List)
if len(s_l) == 3:
  print("Three")
else:
  print("Four")
Buggy python submission (verdict: Runtime Error):
Row = int(input())
List = []
for i in range (Row):
  List.append(list(map(int, input().split())))
x = 0
y = 0
flag = True
for i in range(Row):
  reqT = List[i][1]-x+List[i][2]-y
  chck= reqT - T
  if chck < 0 or chck % 2 == 1:
    flag = False
    break
  x = List[i][1]
  y = List[i][2]
if flag:
  print("Yes")
else:
  print("No")

Fixed submission:
Row = int(input())
List = []
for i in range (Row):
  List.append(list(map(int, input().split())))
x = 0
y = 0
T = 0
flag = True
for i in range(Row):
  reqT = abs(List[i][1]-x)+abs(List[i][2]-y)
  chck= List[i][0] - T - reqT
  if chck < 0 or chck % 2 == 1:
    flag = False
    break
  x = List[i][1]
  y = List[i][2]
  T = List[i][0]
if flag:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s= input()
res = "2018"+s[4,len(s)]
print(res)

Fixed submission:
s= input()
res = "2018"+s[4:len(s)]
print(res)
Buggy python submission (verdict: Runtime Error):
Row = int(input())
List = []
for i in range (Row):
  List.append(list(map(int, input().split())))
s_l = set(List)
print(len(s_l))

Fixed submission:
Row = int(input())
List = []
for i in range (Row):
  List.append(int(input()))
s_l = set(List)
print(len(s_l))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
ListS= list(s)
ListT = list(t)
ListS.sort()
ListT.sort(reverse= True)
S = ""
T = ""
for i in range(len(ListS)):
  S += ListS[i]  
for i in range(len(ListT)):
  T += ListT[i]
if S == T:
  print("No")
else:
  List.append(S)
  List.append(T)
  List.sort()
  if List[0]==S:
    print("Yes")
  else:
    print("No")
  



Fixed submission:
s = input()
t = input()
List=[]
ListS= list(s)
ListT = list(t)
ListS.sort()
ListT.sort(reverse= True)
S = ""
T = ""
for i in range(len(ListS)):
  S += ListS[i]  
for i in range(len(ListT)):
  T += ListT[i]
if S == T:
  print("No")
else:
  List.append(S)
  List.append(T)
  List.sort()
  if List[0]==S:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N =int(input())
List = list(map(int, input().split()))
flag = True
res = 0
while flag:
  for i in range(N):
    if List[i] & 2 == 1:
      flag = False
      break
  if not flag:
    res += 1
print(res)

Fixed submission:
N =int(input())
List = list(map(int, input().split()))
flag = True
res = 0
while flag:
  for i in range(N):
    if List[i] % 2 == 1:
      flag = False
      break
    else:
      List[i] = List[i]//2
  if flag:
    res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
List = ["A","B","C","D","F"]
if a == b:
  print("=")
c = 0
d = 0
for i in range(6):
  if a == List[i]:
    c = i
  if b == List[i]:
    d = i
if c < d:
  print("<")
elif d < c:
  print(">")

Fixed submission:
a,b=map(str,input().split())
List = ["A","B","C","D","E","F"]
if a == b:
  print("=")
c = 0
d = 0
for i in range(6):
  if a == List[i]:
    c = i
  if b == List[i]:
    d = i
if c < d:
  print("<")
elif d < c:
  print(">")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
res = 2 * b -A
print(res)

Fixed submission:
a = int(input())
b = int(input())
res = 2 * b - a
print(res)
Buggy python submission (verdict: Runtime Error):
List = list(map(int, input().split()))
res = 0
for i in range(3):
  for j in range(i,3):
    if List[i] == List[j]:
      res = 6 - i+1 -j+1
print(List[res])

Fixed submission:
List = list(map(int, input().split()))
res = 0
for i in range(2):
  for j in range(i+1,3):
    if List[i] == List[j]:
      res = 3 - i - j
print(List[res])
Buggy python submission (verdict: Runtime Error):
import copy
H,W=map(int,input().split())
List = []
for i in range (H):
  List.append(input())
resList = copy.deepcopy(List)

def bombCheck(x,y,ListX):  
  a = 0
  b = 0
  res = 0
  if ListX[x][y] == "#":
    return "#"
  for i in range(-1,2,1):
    a = x+i
    if a<0 or a >= W:
      pass
    else:
      for j in range(-1,2,1):
        b = y+j
        if b<0 or b >= H:
          pass
        else:
          if i == 0 and j ==0:
            pass
          else:
            if List[a][b] == "#":
              res +=1
            else:
              pass
  return str(res)

for i in range(H):
  resList[i] =""
  for j in range(W):
    resList[i] += bombCheck(i,j,List)
for i in resList:
  print(i)

Fixed submission:
import copy
H,W=map(int,input().split())
List = []
for i in range (H):
  List.append(input())
resList = copy.deepcopy(List)

def bombCheck(x,y,ListX):  
  a = 0
  b = 0
  res = 0
  if ListX[x][y] == "#":
    return "#"
  for i in range(-1,2,1):
    a = x+i
    if 0<= a < H:
      for j in range(-1,2,1):
        b = y+j
        if 0<= b < W:
          if i == 0 and j ==0:
            pass
          else:
            if List[a][b] == "#":
              res +=1
  return str(res)

for i in range(H):
  resList[i] =""
  for j in range(W):
    resList[i] += bombCheck(i,j,List)
for i in resList:
  print(i)
Buggy python submission (verdict: Runtime Error):
S = input()
res = ""
for i in range(0,N,2):
  res += S[i]
print(res)

Fixed submission:
S = input()
res = ""
for i in range(0,len(S),2):
  res += S[i]
print(res)
Buggy python submission (verdict: Runtime Error):
S = input()
List = list(S)
s_l = set(List)
n = 10
res= ""
for i in range(97,113):
  n = s_l.count(chr(i))
  if n == 0:
    res = chr(i)
    break
print(res)

Fixed submission:
S = input()
List = list(S)
s_l = set(List)
n = 10
res= ""
flag = False
for i in range(97,123):
  if not chr(i) in s_l:
    res = chr(i)
    flag = True
    break
if flag:
  print(res)
else:
  print("None")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if A%3 == 0:
  print("Possible")
elif B%3 == 0:
  print("Possible")
elif (A+B)%3 == 0:
  print("Possible")
else:
  print("Impossible")

Fixed submission:
a,b=map(int,input().split())
if a%3 == 0:
  print("Possible")
elif b%3 == 0:
  print("Possible")
elif (a+b)%3 == 0:
  print("Possible")
else:
  print("Impossible")
Buggy python submission (verdict: Runtime Error):
Row = int(input())
List = []
for i in range (Row):
  List.append(int(input()))
s = 1
res = 0
flag = False
for i in range(Row):
  s = List[s]
  res += 1
  if s == 2:
    flag=True
    break
if not flag:
  print(-1)
else:
  print(res)

Fixed submission:
Row = int(input())
List = []
for i in range (Row):
  List.append(int(input()))
s = 1
res = 0
flag = False
for i in range(Row):
  s = List[s-1]
  res += 1
  if s == 2:
    flag=True
    break
if not flag:
  print(-1)
else:
  print(res)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(str,input().split())
Flag = 1
if a[len(a)-1]!=b[0]:
  Flag =0
if b[len(b)-1]!=c[0]:
  Flag =0
if Flag = 0:
  print("NO")
else:
  print("YES")

Fixed submission:
a,b,c=map(str,input().split())
Flag = 1
if a[len(a)-1]!=b[0]:
  Flag =0
if b[len(b)-1]!=c[0]:
  Flag =0
if Flag == 0:
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c=map(int,input().split())
k = 0
m = a % c
if m == 0:
  k = a
else:
  k = c-m + a
res = 0
for i in range(k,b+1,c):
  res += 1
print(res)

Fixed submission:
a,b,c=map(int,input().split())
mini = 0
m = a % c
if m == 0:
  mini = a/c
else:
  mini = (c-m + a)/c
maxi = 0
M = b % c
if M == 0:
  maxi = b//c
else:
  maxi = (b-M)//c
res = int(maxi) - int(mini) + 1
print(res)
Buggy python submission (verdict: Runtime Error):
W,H,N=map(int,input().split())
List = []
for i in range (N):
  List.append(list(map(int, input().split())))
WRange = [0,W]
HRange = [0,H]
for i in range(N):
  if List[i][2] == 1:
    WRange[0] = List[i][0]
  elif List[i][2] == 2:
    WRange[1] = List[i][0]
  elif List[i][2] == 3:
    HRange[0] = List[i][1]
  else List[i][2] == 4:
    HRange[1] = List[i][1]
if WRange[1]-WRange[0] >0:
  W = WRange[1]-WRange[0]
else:
  W = 0
if HRange[1]-HRange[0] >0:
  H = HRange[1]-HRange[0]
else:
  H = 0
res = H * W
print(res)

Fixed submission:
W,H,N=map(int,input().split())
List = []
for i in range (N):
  List.append(list(map(int, input().split())))
WRange = [0,W]
HRange = [0,H]
for i in range(N):
  if List[i][2] == 1:
    WRange[0] = max(WRange[0],List[i][0])
  elif List[i][2] == 2:
    WRange[1] = min(WRange[1],List[i][0])
  elif List[i][2] == 3:
    HRange[0] = max(HRange[0],List[i][1])
  else:
    HRange[1] = min(HRange[1],List[i][1])
if WRange[1]-WRange[0] >0:
  W = WRange[1]-WRange[0]
else:
  W = 0
if HRange[1]-HRange[0] >0:
  H = HRange[1]-HRange[0]
else:
  H = 0
res = H * W
print(res)
Buggy python submission (verdict: Runtime Error):
S = input()
List = list(S)
trial = 0
for i in range(1,len(List)):
  if List[i] != List[i-1]:
    trial += 1
print(res)

Fixed submission:
S = input()
List = list(S)
trial = 0
for i in range(1,len(List)):
  if List[i] != List[i-1]:
    trial += 1
print(trial)
Buggy python submission (verdict: Runtime Error):
N = int(input())
res = int(N(N+1)/2)
print(res)

Fixed submission:
N = int(input())
res = int(N*(N+1)/2)
print(res)
Buggy python submission (verdict: Runtime Error):
A,B,C = int(input())
res = "NO"
if A == 5 or A == 7:
  if B == 5 or B == 7:
    if C == 5 or C == 7:
      if A+B+C == 17:
        res = "YES"
print(res)

Fixed submission:
A,B,C = map(int,input().split())
res = "NO"
if A == 5 or A == 7:
  if B == 5 or B == 7:
    if C == 5 or C == 7:
      if A+B+C == 17:
        res = "YES"
print(res)
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
List = []
for i in range (N):
  List.append(int(input()))
List.sort()
res = ""
for i in range(N):
  res+=List[i]
print(res)

Fixed submission:
N,L=map(int,input().split())
List = []
for i in range (N):
  List.append(str(input()))
List.sort()
res = ""
for i in range(N):
  res+=List[i]
print(res)
Buggy python submission (verdict: Runtime Error):
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1))

Fixed submission:
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1,0))

Buggy python submission (verdict: Runtime Error):
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:])))))

Fixed submission:
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1,0))

Buggy python submission (verdict: Runtime Error):
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:])))))

Fixed submission:
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1,0))

Buggy python submission (verdict: Runtime Error):
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str,open(0))][1:])))))

Fixed submission:
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1,0))

Buggy python submission (verdict: Runtime Error):
from networkx import *
print(max(*map(len,connected_components(Graph([input().split()][1:])))))

Fixed submission:
from networkx import *
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1,0))
Buggy python submission (verdict: Time Limit Exceeded):
n,d=map(int,input().split())
print(sum(eval("(("+input().replace(" ",")**2+(")+")**2)**0.5<=d") for _ in range(n)))

Fixed submission:
n,d=map(int,input().split())
print(sum(eval("(("+input().replace(" ",")**2+(")+")**2)")**0.5<=d for _ in range(n)))

Buggy python submission (verdict: Time Limit Exceeded):
n,d=map(int,input().split())
print(sum(eval("(("+input().replace(" ",")**2+(")+")**2)**0.5<=d") for _ in range(n)))

Fixed submission:
n,d=map(int,input().split())
print(sum(eval("(("+input().replace(" ",")**2+(")+")**2)")**0.5<=d for _ in range(n)))
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
if k&1==0:
  print(-1)
  exit()
elif 7%k==0:
  print(1)
  exit()
m=7
a=b=1
while(m>0):
  a=a*10%k
  m=(m+7*a)%k
  b+=1
print(b)

Fixed submission:
k=int(input())
if k&1==0 or k%5==0:
  print(-1)
  exit()
elif 7%k==0:
  print(1)
  exit()
m=7
a=b=1
while(m>0):
  a=a*10%k
  m=(m+7*a)%k
  b+=1
print(b)