Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):

S, T = input().split(" ")
S = int(S)
T = int(T)
TS = T+S

print("{}".format(TS))

Fixed submission:
S, T = input().split(" ")
print("{}".format(T+S))

Buggy python submission (verdict: Runtime Error):
S,T = map(String, input().split())
print('{}{}'.format(T, S))

Fixed submission:
S,T = input().split()
#print('{}{}'.format(T, S))
print(T+S)

Buggy python submission (verdict: Runtime Error):
S,T = map(string, input().split())
print('{}{}'.format(T, S))

          
          

Fixed submission:
S,T = input().split()
#print('{}{}'.format(T, S))
print(T+S)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
strings = list(stdin.readline().split())
print(string[1] + string[0])


Fixed submission:
from sys import stdin
strings = list(stdin.readline().split())
print(strings[1] + strings[0])
Buggy python submission (verdict: Time Limit Exceeded):
'''input
3 5
1 2 1
2 3 0
'''
# connected components
from sys import stdin, setrecursionlimit
from bisect import bisect_left
import sys, threading
from collections import defaultdict


def power(a, x, mod):
    if x == 0:
        return 1
    temp = power(a, x//2, mod) % mod
    if x % 2:
        return ((temp * temp) % mod * a) % mod
    else:
        return ((temp * temp)% mod)


# main starts
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
ans = 0
mod = 10 ** 9 + 7
for i in range(60):
    num = 1 << i
    count = 0
    for k in range(n):
        if num & arr[k] == 0:
            count += 1
    # print(num, count, n - count)
    ans += (power(2, i, mod) *(count * (n - count)) % mod) % mod
    ans %= mod
print(ans)

Fixed submission:
'''input
3 5
1 2 1
2 3 0
'''
# connected components
from sys import stdin, setrecursionlimit
from bisect import bisect_left
import sys, threading
from collections import defaultdict


def power(a, x, mod):
    if x == 0:
        return 1
    temp = power(a, x//2, mod) % mod
    if x % 2:
        return ((temp * temp) % mod * a) % mod
    else:
        return ((temp * temp)% mod)


# main starts
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
ans = 0
mod = 10 ** 9 + 7
for i in range(60):
    num = 1 << i
    count = 0
    for k in range(n):
        if num & arr[k] == 0:
            count += 1
    # print(num, count, n - count)
    ans += (power(2, i, mod) *(count * (n - count)) % mod) % mod
    ans %= mod
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
print(T + S)

Fixed submission:
ST = input()
S, T = ST.split(" ")
print(T + S)
Buggy python submission (verdict: Runtime Error):
from math import gcd
A, B, C, D = list(map(int, input().split()))
num_B_C = B // C
num_B_D = B // D
lcm_C_D = int(C * D / gcd(C, D))
num_B = B - (num_B_C + num_B_D) + B // lcm_C_D

num_A_C = (A-1) // C
num_A_D = (A-1) // D
num_A = (A-1) - (num_A_C + num_A_D) + (A-1) // lcm_C_D

ans = num_B - num_A
print(ans)

Fixed submission:
from fractions import gcd
A, B, C, D = list(map(int, input().split()))
num_B_C = B // C
num_B_D = B // D
lcm_C_D = int(C * D / gcd(C, D))
num_B = B - (num_B_C + num_B_D) + B // lcm_C_D

num_A_C = (A-1) // C
num_A_D = (A-1) // D
num_A = (A-1) - (num_A_C + num_A_D) + (A-1) // lcm_C_D

ans = num_B - num_A
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int, input().split))
result = 0
for _ range(2):
  if a >= b:
    result += a
    a -= 1
  else:"
    result += b
    b -= 1
print(result)

Fixed submission:
a, b = list(map(int, input().split()))
result = 0
for _ in range(2):
  if a >= b:
    result += a
    a -= 1
  else:
    result += b
    b -= 1
print(result)
Buggy python submission (verdict: Runtime Error):
deata = list(input())
count = 0
for i in range(1, len(data)):
  if data[i] == data[i-1]:
    if data[i] == "0":
      data[i] = "1"
    else:
      data[i] = "0"
    count += 1
print(count)

Fixed submission:
data = list(input())
count = 0
for i in range(1, len(data)):
  if data[i] == data[i-1]:
    if data[i] == "0":
      data[i] = "1"
    else:
      data[i] = "0"
    count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for ii in range(k):
    if a > 0:
        a -= 1
    else:
        if b > 0:
            b -= 1
print(a, b)

Fixed submission:
a, b, k = map(int, input().split())
if a >= k:
    a -= k
    print(a, b)
elif a < k:
    if b >= (k-a):
        b = b - (k - a)
        print(0, b)
    elif b < (k-a):
        print(0, 0)

Buggy python submission (verdict: Time Limit Exceeded):
abk = input().split()
abk2 = []
for ee in abk:

    abk2.append(int(ee))
a, b, k = abk2
for ii in range(k):
    if a > 0:
        a -= 1
    else:
        b -= 1
print(a, b)

Fixed submission:
a, b, k = map(int, input().split())
if a >= k:
    a -= k
    print(a, b)
elif a < k:
    if b >= (k-a):
        b = b - (k - a)
        print(0, b)
    elif b < (k-a):
        print(0, 0)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split()) 
 
count = 1
an = []
bn = []
eee = min(a,b)
 
for ii in range(1, eee+2):
    bbb = b * ii
    bn.append(bbb)
 
while True:
    aaa = a * count
    )
    if aaa in bn:
        print(aaa)
        break
    count += 1

Fixed submission:
a = int(input()) 
b = int(input())


listt = []
listt.append(a)
listt.append(b)
if 1 in listt and 2 in listt:
    print(3)

if 2 in listt and 3 in listt:
    print(1)

if 1 in listt and 3 in listt:
    print(2)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split()) 
 
count = 1
an = []
bn = []
eee = min(a,b)
 
for ii in range(1, eee+2):
    bbb = b * ii
    bn.append(bbb)
 
while True:
    aaa = a * count
    
    if aaa in bn:
        print(aaa)
        break
    count += 1

Fixed submission:
a, b = map(int, input().split()) 
count = 1
 
while True:
    aaa = a * count
    if aaa % b == 0:
        print(aaa)
        break

    count += 1
Buggy python submission (verdict: Runtime Error):
L,R = input().split()
print R + L

Fixed submission:
L,R = input().split()
k = R + L
print (k)

Buggy python submission (verdict: Runtime Error):
a, b= (int(i) for i in input().split())
print b + a

Fixed submission:
L,R = input().split()
k = R + L
print (k)

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
print (t + s)

Fixed submission:
L,R = input().split()
k = R + L
print (k)

Buggy python submission (verdict: Runtime Error):
print (sys.argv[2]+ sys.argv[1])

Fixed submission:
L,R = input().split()
k = R + L
print (k)

Buggy python submission (verdict: Runtime Error):
a[0] = input()
a[1] = input()
print (a[1] + a[0])

Fixed submission:
L,R = input().split()
k = R + L
print (k)

Buggy python submission (verdict: Runtime Error):
a[0] = input()
a[1] = input()
print a[1] + a[0]

Fixed submission:
L,R = input().split()
k = R + L
print (k)

Buggy python submission (verdict: Runtime Error):
a[0] = input()
a[1] = input()
print a[0] + a[1]

Fixed submission:
L,R = input().split()
k = R + L
print (k)

Buggy python submission (verdict: Runtime Error):
string = int().split()
print(string[1] + string[0])

Fixed submission:
string = input().split()
print(string[1] + string[0])
Buggy python submission (verdict: Runtime Error):
number = input().split()
if number[0] + number[1] + number[2] >= 22:
  print('bust')
else:
  print('win')  


Fixed submission:
number = input().split()
if int(number[0]) + int(number[1]) + int(number[2]) >= 22:
  print('bust')
else:
  print('win')

Buggy python submission (verdict: Runtime Error):
number = input().split()
if number[0] + number[1] + number[2] >= 22:
  print(bust)
else:
  print(win)  

Fixed submission:
number = input().split()
if int(number[0]) + int(number[1]) + int(number[2]) >= 22:
  print('bust')
else:
  print('win')
Buggy python submission (verdict: Runtime Error):
print(r * r)

Fixed submission:
r = int(input())
print(r * r)
Buggy python submission (verdict: Runtime Error):
a,b=input(),split()
print(a+b)

Fixed submission:
a,b=input().split()
print(b+a)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a>=k:
  print(a-k,b)
else:
  print(0,max(a+b-k,0))

Fixed submission:
a,b,c=map(int,input().split())
if a >= c:
  print(a-c,b)
else:
  print(0,max(a+b-c,0))

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a >= c:
  print(a-c,0)
else:
  print(0.max(a+b-c,0))

Fixed submission:
a,b,c=map(int,input().split())
if a >= c:
  print(a-c,b)
else:
  print(0,max(a+b-c,0))

Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if a >= c:
  print(a-c,b)
else:
  print(0,max(a+b-c,0))

Fixed submission:
a,b,c=map(int,input().split())
if a >= c:
  print(a-c,b)
else:
  print(0,max(a+b-c,0))

Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()

for i in range(c)
	if a >= 1:
    	a -= 1
    elif b>= 1:
    	b -= 1
    else:

print(a b)
        

Fixed submission:
a,b,c=map(int,input().split())
if a >= c:
  print(a-c,b)
else:
  print(0,max(a+b-c,0))
Buggy python submission (verdict: Runtime Error):
a=input()

def prime(n):
  for i in range(2,n):
    if n%i == 0:
      return False
    return True
  
while prime(a) == False:
  a += 1

print(a)
    

Fixed submission:
a=int(input())

def prime(n):
  if n <= 1:
    return False
  else:
    for i in range (2,n):
      if n%i == 0:
        return False
    return True
        
while prime(a)==False:
    a += 1

print(a)

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

def prime(n):
  if n <= 1:
    return False
  else:
    for i in range(2,n):
      if n%i == 0:
      	return False
      return True
    
while prime(a)==False:
  a += 1

print(a)

Fixed submission:
a=int(input())

def prime(n):
  if n <= 1:
    return False
  else:
    for i in range (2,n):
      if n%i == 0:
        return False
    return True
        
while prime(a)==False:
    a += 1

print(a)
Buggy python submission (verdict: Runtime Error):
S=list(map(int.input().split()))
T=list(map(int.input().split()))
x = 0
for i in range(3):
  if S[i] == T[i]:
    x += 1
print(x)


Fixed submission:
S=input()
T=input()
x = 0
for i in range(3):
  if S[i] == T[i]:
    x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
S=list(map(int.input().split()))
T=list(map(int.input().split()))
int x = 0

for i in range(3):
  if S[i] == T[i]:
    x += 1
print(x)


Fixed submission:
S=input()
T=input()
x = 0
for i in range(3):
  if S[i] == T[i]:
    x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
S=list(map(int.input().split()))
T=list(map(int.input().split()))
int x=0

for S[] in T[]:
  x += 1
  
print(x)
  

Fixed submission:
S=input()
T=input()
x = 0
for i in range(3):
  if S[i] == T[i]:
    x += 1
print(x)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c = a*b
if c%2 == 0:
	print("Even")
  else:
  	print("Odd")
 

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print(Odd)
else:
  print(Even)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=(a*b)%2
if c == 1:
  print(Odd)
else:
  print(Even)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
c=(a*b)%2
if c == 1:
  print(Odd)
else:
  print(Even)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
c=(a*b)%2
if c == 1:
  print("Odd")
else:
  print("Even")

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b=int(input().split())
c=(a*b)%2
if c==1:
  print("Odd")
else:
  print("Even")

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
c=(a*b)%2
if c==1:
  print("Odd")
else:
  print("Even")

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')
Buggy python submission (verdict: Runtime Error):
s=list(map(int,input().split()))
x=0
for i in 1:
  s[i] = 1
  x+=1
print(x)

Fixed submission:
s=input()
print(s.count("1"))

Buggy python submission (verdict: Runtime Error):
s=list(map(int,input().split()))
x=0
for s in 1:
  x+=1
print(x)

Fixed submission:
s=input()
print(s.count("1"))
Buggy python submission (verdict: Runtime Error):
import sys
import fractions as fl

a, b, c, d = list(input().split())
a = int(a)
b = int(b)
c = int(c)
d = int(d)

#全体の個数
all = b - a + 1
#cとdの最小公倍数
e = c * d // fl.gcd(c, d)
# a以下でcまたはdで割れる個数
r1 = (a-1) // c + (a-1) // d - (a-1) // e
# b以下でcまたはdで割れる個数
r2 = b // c + b // d - b // e
ans = all - (r2 - r1)
print(ans)

Fixed submission:
import sys

S = input()

S = list(str(S))
for i in range(3):
    if S[i] == S[i+1]:
        result = "Bad"
        break
    else:
        result = "Good"
print(result)
Buggy python submission (verdict: Runtime Error):
import sys
import math

args = sys.argv
n = args[0]
l = args[1]

n = int(n)
l = int(l)

all = []
for i in range(n):
    all.append(l+i)
all_sum = sum(all)

minus = 10000
ans = 0
for i in range(len(all)):
    if math.fabs(all_sum - (all_sum - all[i])) < math.fabs(minus):
        minus = math.fabs(all_sum - (all_sum -all[i]))
        ans = all_sum -all[i]
print(ans)


Fixed submission:
import sys
import math

n, l = list(input().split())
n = int(n)
l = int(l)

all = []
for i in range(n):
    all.append(l+i)
all_sum = sum(all)

minus = 10000
ans = 0
for i in range(len(all)):
    if math.fabs(all_sum - (all_sum - all[i])) < math.fabs(minus):
        minus = math.fabs(all_sum - (all_sum -all[i]))
        ans = all_sum -all[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv
n = args[0]
l = args[1]

n = int(n)
l = int(l)

all = []
for i in range(n):
    all.append(l+i)
all_sum = sum(all)

minus = 10000
ans = 0
for i in range(len(all)):
    if abs(all_sum - (all_sum - all[i])) < abs(minus):
        minus = abs(all_sum - (all_sum -all[i]))
        ans = all_sum -all[i]
print(ans)

Fixed submission:
import sys
import math

n, l = list(input().split())
n = int(n)
l = int(l)

all = []
for i in range(n):
    all.append(l+i)
all_sum = sum(all)

minus = 10000
ans = 0
for i in range(len(all)):
    if math.fabs(all_sum - (all_sum - all[i])) < math.fabs(minus):
        minus = math.fabs(all_sum - (all_sum -all[i]))
        ans = all_sum -all[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import fractions as fl

#a, b, c, d = list(input().split())
a = int(a)
b = int(b)
c = int(c)
d = int(d)

#全体の個数
all = b - a + 1
#cとdの最小公倍数
e = c * d // fl.gcd(c, d)
# a以下でcまたはdで割れる個数
r1 = (a-1) // c + (a-1) // d - (a-1) // e
# b以下でcまたはdで割れる個数
r2 = b // c + b // d - b // e
ans = all - (r2 - r1)
print(ans)

Fixed submission:
import sys
import fractions as fl

a, b, c, d = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)

#全体の個数
all = b - a + 1
#cとdの最小公倍数
e = c * d // fl.gcd(c, d)
# a以下でcまたはdで割れる個数
r1 = (a-1) // c + (a-1) // d - (a-1) // e
# b以下でcまたはdで割れる個数
r2 = b // c + b // d - b // e
ans = all - (r2 - r1)
print(ans)

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

a, b, c, d = list(input().split())
a = int(a)
b = int(b)
c = int(c)
d = int(d)

# A: 5 B: 10 C: 3 D: 7
ans = 0
for i in range(b-a+1):
    n = i + a
    if n % c != 0 and n % d != 0:
        ans += 1
print(ans)

Fixed submission:
import sys
import fractions as fl

a, b, c, d = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)

#全体の個数
all = b - a + 1
#cとdの最小公倍数
e = c * d // fl.gcd(c, d)
# a以下でcまたはdで割れる個数
r1 = (a-1) // c + (a-1) // d - (a-1) // e
# b以下でcまたはdで割れる個数
r2 = b // c + b // d - b // e
ans = all - (r2 - r1)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int, input().split()) 
if a>=k:
  print(a-k,b)
else:
  print(0,max(a-k+b, 0))

Fixed submission:
s, t = input().split()

print(t+s)

Buggy python submission (verdict: Runtime Error):
taka, aoki, action = map(int, input().split())
 
if taka >= action:
  print(taka-action, aoki)
  
else:
  print(0, max(taka+aoki-action, 0))

Fixed submission:
s, t = input().split()

print(t+s)

Buggy python submission (verdict: Runtime Error):
s = input('')
t = input('')

print(t+s)

Fixed submission:
s, t = input().split()

print(t+s)
Buggy python submission (verdict: Runtime Error):
taka, aoki, action = map(int, input().split())
 
if taka >= action:
  print(taka-action, aoki)
 
else:
  print(0, max(aoki-(action-taka, 0)))

Fixed submission:
taka, aoki, action = map(int, input().split())
 
if taka >= action:
  print(taka-action, aoki)
  
else:
  print(0, max(taka+aoki-action, 0))

Buggy python submission (verdict: Runtime Error):
taka, aoki, action = int(input().split())

for i in range(action):
  if taka > 0:
    taka -= 1
    continue
  
  elif aoki > 0:
    aoki -= 1
    continue
  
  else:
    break

print(taka, aoki)

Fixed submission:
taka, aoki, action = map(int, input().split())
 
if taka >= action:
  print(taka-action, aoki)
  
else:
  print(0, max(taka+aoki-action, 0))

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = list(map(int, input().split()))

for idx in range(k):
  if (a >= 1):
    a = a - 1
  elif (b >= 1) :
    b = b -1
  else :
    pass

print("%s %s" % (a,b))

Fixed submission:
a,b,k = list(map(int, input().split()))

temp_a = a
if (k >= a):
  a = 0
else :
  a = (a - k)
k = k - temp_a

if k < 0 :
  k = 0
if (k >= b):
  b = 0
else :
  b = (b - k)


print("%s %s" % (a,b))

Buggy python submission (verdict: Runtime Error):
a, b, k = input().split()
print(max(a - k, 0), b - max(k - a, 0))


Fixed submission:
a, b, k = map(int, input().split())
print(max(a - k, 0), max(b - max(k - a, 0), 0))
Buggy python submission (verdict: Runtime Error):
array = [1, 2, 3]

for _ in range(3):
  num = int(input())
  array.pop(array.index(num))

print(array[0])


Fixed submission:
array = [1, 2, 3]
 
for _ in range(2):
  num = int(input())
  array.pop(array.index(num))
 
print(array[0])
Buggy python submission (verdict: Runtime Error):
_ = input()
a, b = input().split()

result = ""

for a_, b_ in zip(a, b):
	result += a_ + b+

print(result)


Fixed submission:
_ = input()
a, b = input().split()
 
result = ""
 
for a_, b_ in zip(a, b):
	result += a_ + b_
 
print(result)
Buggy python submission (verdict: Runtime Error):

if __name__ == "__main__":
  law = 10 ** 9 + 7
  
  dest_x, dest_y = sorted(map(int, input().split()), reverse=True)
  W = H = dest_x + 1
  
  num_pattern = [[0] * W for j in range(H)]
  
  num_pattern[0][0] = 1
  
  stack = [(0, 0, 0, 0)]
  moves = [(1, 2), (2, 1)]
  
  while(stack):
    x, y, or_x, or_y = stack.pop(0)
    
    for dx, dy in moves:
      if x + dx != or_x and y + dy != or_y and 0 <= x + dx < W and 0 <= y + dy < H and x + dx >= y + dy:
        num_pattern[x + dx][y + dy] += num_pattern[x][y]
        stack.append((x + dx, y + dy, x, y))
      
  print(num_pattern[dest_x][dest_y] * 2 % law)
  pass


Fixed submission:
import math
import functools

law = 10 ** 9 + 7
def mul_mod(x, y):
  return x * y % law

def prod_mod(seq):
  return functools.reduce(mul_mod, seq, 1)
#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m
  
def comb(n, k):
  return prod_mod(i for i in range(n - k + 1, n + 1)) * mod_inv(prod_mod(i for i in range(1, k + 1)), law) % law

if __name__ == "__main__":
  
  x, y = sorted(map(int, input().split()), reverse=True)
  
  if (x + y) % 3 != 0:
    print(0)
  else:
    print(comb((x + y) // 3, x - (x + y) // 3))
Buggy python submission (verdict: Runtime Error):
N = int(intput())

print((N - N % 2) * (N + N % 2)/4)


Fixed submission:
N = int(input())
a = int((N - N % 2) * (N + N % 2)/4)
print(a)
Buggy python submission (verdict: Runtime Error):
a = int(input())

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else
    print("AGC")

Fixed submission:
a = int(input())

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")
Buggy python submission (verdict: Time Limit Exceeded):
import re

def calc(people):
    ans = 10 ** 6

    for i, p in enumerate(people):
        Ws = people[0:i].count("W")
        Es = people[i+1:].count("E")

        ans = min(ans, Ws + Es)
    
    return ans


if __name__ == "__main__":
    _ = input()
    people = input()

    print(calc(people))


Fixed submission:
import re

def calc(people):
    Ws = 0
    Es = people[1:].count("E")
    ans = Ws + Es

    for i in range(1, len(people)):
        if people[i] == "E":
            Es -= 1
        
        if people[i - 1] == "W":
            Ws += 1

        ans = min(ans, Ws + Es)
    
    return ans


if __name__ == "__main__":
    _ = input()
    people = input()

    print(calc(people))
Buggy python submission (verdict: Runtime Error):
S, T = input()
print(T+S)

Fixed submission:
S, T = raw_input().split()
print T+S

Buggy python submission (verdict: Runtime Error):
S, T = input()
print(T,S)

Fixed submission:
S, T = raw_input().split()
print T+S
Buggy python submission (verdict: Time Limit Exceeded):
input_line = input().split(' ')
taka = int(input_line[0])
aoki = int(input_line[1])
numK = int(input_line[2])
 
for i in range(numK):
  if taka >= 1:
    taka -= 1
    continue
  elif aoki >= 1:
    aoki -= 1
    continue
  else:
    break
 
print(str(taka) + ' ' + str(aoki))

Fixed submission:
input_line = input().split(' ')
taka = int(input_line[0])
aoki = int(input_line[1])
numK = int(input_line[2])
result = ""
if taka + aoki <= numK:
  result = "0 0"
elif taka >= numK:
  result = str(taka - numK) + " " + str(aoki)
elif taka + aoki > numK:
  result = "0 " + str(taka + aoki - numK)
  
print(result)

Buggy python submission (verdict: Runtime Error):
input_line = input().split(' ')
taka = int(input_line[0])
aoki = int(input_line[1])
numK = int(input_line[2])

for i in range(k):
  if taka >= 1:
    taka -= 1
    continue
  elif aoki >= 1:
    aoki -= 1
    continue
  else:
    break

print(taka + ' ' + aoki)

Fixed submission:
input_line = input().split(' ')
taka = int(input_line[0])
aoki = int(input_line[1])
numK = int(input_line[2])
result = ""
if taka + aoki <= numK:
  result = "0 0"
elif taka >= numK:
  result = str(taka - numK) + " " + str(aoki)
elif taka + aoki > numK:
  result = "0 " + str(taka + aoki - numK)
  
print(result)