Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = input()
l = []
l += [str(n) + ":"]
while 1:
    if n == 1:break
    for i in count(2):
        if n % i == 0:
            n /= i
            l += [i]
            break
print " ".join(map(str,l))

Fixed submission:
n = input()
l = []
l += [str(n)+":"]
i = 2
while i * i <= n:
    while n % i == 0:
        l += [i]
        n /= i
    i += 1
if n > 1: l += [n]
print " ".join(map(str,l))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import count
n = input()
l = []
l += [str(n) + ":"]
while 1:
    if n == 1:break
    for i in count(2):
        if n % i == 0:
            n /= i
            l += [i]
            break
print " ".join(map(str,l))

Fixed submission:
n = input()
l = []
l += [str(n)+":"]
i = 2
while i * i <= n:
    while n % i == 0:
        l += [i]
        n /= i
    i += 1
if n > 1: l += [n]
print " ".join(map(str,l))

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
l = []
l += [str(n) + ":"]
while 1:
    if n == 1:break
    for i in xrange(2,n+1):
        if n % i == 0:
            n /= i
            l += [i]
            break
print " ".join(map(str,l))

Fixed submission:
n = input()
l = []
l += [str(n)+":"]
i = 2
while i * i <= n:
    while n % i == 0:
        l += [i]
        n /= i
    i += 1
if n > 1: l += [n]
print " ".join(map(str,l))
Buggy python submission (verdict: Runtime Error):
def composite(d,n,s):
    for a in (2,3,5,7):
        maybe_prime = False
        if pow(a,d,n) == 1:
            maybe_prime = True
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                maybe_prime = True
                break
        return not probably_prime
    return False

def is_prime(n):
    if n==2:
        return True
    elif n%2==0:
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(input())
for i in range(n):
  n = int(input())
  if is_prime(n):
      if n not in r:
          r.append(n)

print(len(r))

Fixed submission:
def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False
  
def is_prime(n):
    if n in (2,3,5,7):
        return True
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(input())
for i in range(n):
  n = int(input())
  if is_prime(n):
    r.append(n)
  
print(len(r))
Buggy python submission (verdict: Runtime Error):
import sys

n = int(input())
r0 = int(input())
r1 = int(input())
mx = r1-r0
mn = min(r1,r0)

for i in map(int,sys.stdin.readlines()):
    if 0 < mx < i - mn:
        mx = i - mn
    elif 0 > i-mn > max:
        mx = i - mn
        mn = i
    elif mn > i:
        mn = i

print(mx)

Fixed submission:
import sys

n = int(input())
r0 = int(input())
r1 = int(input())
mx = r1-r0
mn = min(r1,r0)

for i in map(int,sys.stdin.readlines()):
    if mx < i - mn:
        mx = i - mn
        if 0 > i-mn:
            mn = i
    elif mn > i:
        mn = i

print(mx)
Buggy python submission (verdict: Runtime Error):
import os
import math

def main():
    lst = [0,0,0,0,0,0]
    for i in range(0, int(input())):
        temp = float(input())
        if temp < 165:
            lst[0] += 1
        elif temp < 170:
            lst[1] += 1
        elif temp < 175:
            lst[2] += 1
        elif temp < 180:
            lst[3] += 1
        elif temp < 185:
            lst[4] += 1
        else:
            lst[5] += 1
    for i in range(0,6):
        print("{}:".format(i+1), end="")
        for j in range(0,lst[i]):
            print("*", end = "")
        print()

main()

Fixed submission:
import os
import math

def main():
    lst = [0,0,0,0,0,0]
    for i in range(0, int(input())):
        temp = float(input())
        if temp < 165:
            lst[0] += 1
        elif temp < 170:
            lst[1] += 1
        elif temp < 175:
            lst[2] += 1
        elif temp < 180:
            lst[3] += 1
        elif temp < 185:
            lst[4] += 1
        else:
            lst[5] += 1
    for i in range(0,6):
        print("{}:".format(i+1), end="")
        for j in range(0,lst[i]):
            print("*", end = "")
        print()

main()
Buggy python submission (verdict: Runtime Error):
object Main {
  def main(args: Array[String]): Unit = {
    println("Hello World")
  }
}

Fixed submission:
a = [x for x in range(9)]

for i in a:
    for j in a:
        print("{}x{}={}".format(i + 1, j + 1, (i + 1) * (j + 1)))
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"



def main():
    num = [10 ** 4, 10 ** 8, 10 ** 12, 10 ** 16, 10 ** 20, 10 ** 24, 10 ** 28, 10 ** 32, 10 ** 36, 10 ** 40, 10 ** 44, 10 ** 48, 10 ** 52, 10 ** 52, 10 ** 56, 10 ** 60, 10 ** 64, 10 ** 68]
    uni = ["Man", "Oku", "Cho", "Kei", "Gai", "Jo", "Jou", "Ko", "Kan", "Sei", "Sai", "Gok", "Gas", "Asg", "Nyt", "Fks", "Mts"]

    while True:
        m, n = map(int, input().split())
        if m == 0 and n == 0:
            break

        a = m ** n
        ans = ""
        for i in range(len(num) - 1, -1, -1):
            if a >= num[i]:
                ans += str(a // num[i]) + uni[i]
                a %= num[i]

        print(ans + str(a if a != 0 else ""))


if __name__ == '__main__':
    main()



Fixed submission:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"


def main():
    num = [10 ** 4, 10 ** 8, 10 ** 12, 10 ** 16, 10 ** 20, 10 ** 24, 10 ** 28, 10 ** 32, 10 ** 36, 10 ** 40, 10 ** 44, 10 ** 48, 10 ** 52, 10 ** 56, 10 ** 60, 10 ** 64, 10 ** 68]
    uni = ["Man", "Oku", "Cho", "Kei", "Gai", "Jo", "Jou", "Ko", "Kan", "Sei", "Sai", "Gok", "Ggs", "Asg", "Nyt", "Fks", "Mts"]
    while True:
        m, n = map(int, input().split())
        if m == 0 and n == 0:
            break

        a = m ** n
        ans = ""
        for i in range(len(num) - 1, -1, -1):
            if a >= num[i]:
                ans += str(a // num[i]) + uni[i]
                a %= num[i]

        print(ans + str(a if a != 0 else ""))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
print(int(input())*int(input())*int(input()))



Fixed submission:
n = int(input())
print(n*n*n)
Buggy python submission (verdict: Runtime Error):
 h, w = map(int, input().split())

print(h*w)
print(2*h + 2*w)



Fixed submission:
h, w = map(int, input().split())

print(h*w, 2*h+2*w)

Buggy python submission (verdict: Runtime Error):
 h, w = map(int, src.input().split())

print(h*w, 2*h+2*w)



Fixed submission:
h, w = map(int, input().split())

print(h*w, 2*h+2*w)

Buggy python submission (verdict: Runtime Error):
 h, w = map(int, input().split())

print(h*w, 2*h+2*w)



Fixed submission:
h, w = map(int, input().split())

print(h*w, 2*h+2*w)
Buggy python submission (verdict: Runtime Error):
a, b = [int(n) for n in src.readline().split()]
print('%s %s %.5f' % (a//b, a%b, a/b))


Fixed submission:
a, b = [int(n) for n in input().split()]
print('%s %s %.5f' % (a//b, a%b, a/b))
Buggy python submission (verdict: Runtime Error):
from math import pi

r = int(input())

print('%.6f %.6f' % (r*r*pi, 2*r*pi))



Fixed submission:
from math import pi
 
r = float(input())
 
print('%.6f %.6f' % (r*r*pi, 2*r*pi))
Buggy python submission (verdict: Runtime Error):
import math

r = int(input())

area          = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

Fixed submission:
import math

r = float(input())

area = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

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

r = int(input())

area          = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

Fixed submission:
import math

r = float(input())

area = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

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

operators = {
    "+": lambda a, b: a + b,
    "-": lambda a, b: a - b,
    "*": lambda a, b: a * b,
    "/": lambda a, b: a // b,
    }

for line in sys.stdin:
    raw_a, op, raw_b = line.rstrip().split()
    if op == "?":
        break

    a, b = map(int, [raw_a, raw_b])
    result = operators[op](a, b)

    print(result)

Fixed submission:
import math

r = float(input())

area = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

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

r = int(input())

area          = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

Fixed submission:
import math

r = float(input())

area = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

Buggy python submission (verdict: Runtime Error):
input() # skip
nums = input().split()

reversed_nums = reversed(nums)

print(' '.join(reversed_nums))

Fixed submission:
import math

r = float(input())

area = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))
Buggy python submission (verdict: Runtime Error):
nums = map(int, input().split())

sorted_nums = sorted(nums)

print(' '.join(sorted_nums))

Fixed submission:
nums = map(int, input().split())

sorted_nums = sorted(nums)

print(' '.join(map(str, sorted_nums)))
Buggy python submission (verdict: Runtime Error):
import sys

for line in sys.stdin:
    if line === '0 0\n':
        break

    nums = map(int, line.split())
    sorted_nums = sorted(nums)
    print(' '.join(map(str, sorted_nums)))

Fixed submission:
import sys

i = 0
for line in sys.stdin:
    i = i + 1
    n = int(line.rstrip())
    if n == 0:
        break

    print("Case %d: %s" % (i, n))
Buggy python submission (verdict: Runtime Error):
while True
    card = input().rstrip()
    if card == '-':
        break

    no_shuffle = int(input())
    for _ in range(no_shuffle):
        h = int(input())
        card = card[:h] + card[h:]

    print(card)

Fixed submission:
while True:
    card = input().strip()
    if card == '-':
        break

    no_shuffles = int(input())
    for _ in range(no_shuffles):
        h = int(input())
        card = card[h:] + card[:h]

    print(card)
Buggy python submission (verdict: Runtime Error):
import numpy as np

r = int(input())
print ('{0:.6f} {1:.6f}'.format(r*r*np.pi, 2*r*np.pi))


Fixed submission:
# coding : utf-8
import math as m
r = float(input())
print ('{0:.6f} {1:.6f}'.format(r*r*m.pi, 2*r*m.pi))

Buggy python submission (verdict: Runtime Error):
import numpy as np

r = float(input())
print ('{0:.6f} {1:.6f}'.format(r*r*np.pi, 2*r*np.pi))


Fixed submission:
# coding : utf-8
import math as m
r = float(input())
print ('{0:.6f} {1:.6f}'.format(r*r*m.pi, 2*r*m.pi))
Buggy python submission (verdict: Runtime Error):
# coding : utf-8
n = int(input())
lst = map(int, input().split())
for i in range(n-1, -1, -1):
    print ('%d ' % lst[i], end = '')
print ('')


Fixed submission:
n = int(input())
lst = list(map(int, input().split()))
counter = 0
for i in (reversed(lst)):
    counter += 1
    print (i, end="")
    if counter != n:
        print ("", end=" ")
print ("")
Buggy python submission (verdict: Runtime Error):
import sys
slist = [i for i in range(1, 14)]
hlist = [i for i in range(1, 14)]
clist = [i for i in range(1, 14)]
dlist = [i for i in range(1, 14)]
for line in sys.stdin:
    suit, rank = line.split()
    rankn = int(rank)
    if suit = 'S':
        if rankn in slist:
            slist.pop(rankn - 1)
    elif suit = 'H':
        if rankn in hlist:
            hlist.pop(rankn - 1)
    elif suit = 'C':
        if rankn in clist:
            clist.pop(rankn - 1)
    else:
        if rankn in dlist:
            dlist.pop(rankn - 1)


Fixed submission:
lst = [True for i in range(52)]
n = int(input())
for i in range (n):
    suit, rank = input().split()
    rankn = int(rank)
    if suit == 'S':
        lst[rankn-1] = False
    elif suit == 'H':
        lst[rankn+12] = False
    elif suit == 'C':
        lst[rankn+25] = False
    else:
        lst[rankn+38] = False
for i in range(52):
    tf = lst[i]
    if i <= 12 and tf:
        print ('S %d' % (i+1))
    elif 12 < i <= 25 and tf:
        print ('H %d' % (i-12))
    elif 25 < i <= 38 and tf:
        print ('C %d' % (i-25))
    elif tf:
        print ('D %d' % (i-38))
Buggy python submission (verdict: Runtime Error):
for i in range(1,10):
  for j in range(1,10);
    print('{}x{}={}', i, j, i*j)


Fixed submission:
for i in range(1,10):
	for j in range(1,10):
		print("{0}x{1}={2}".format(i,j,i*j))
Buggy python submission (verdict: Runtime Error):
while True:
  str = input()
  if str == "EOF" :
      break
  d = 1
  a , b = str.split(' ')
  s = int(a) + int(b)
  while s > 9:
     s = s / 10
     d = d + 1
  print(d)

Fixed submission:
while True:
    try:
        a, b = map(int, input().split())
        print(len(str(a+b)))
    except EOFError:
        break
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
	s=input.split()
	for j in range(len(s)):
		s[j]=int(s[j])
	s.sort()
	print("YES" if(pow(s[0],2)+pow(s[1],2)==pow(s[2],2)) else "NO")


Fixed submission:
t = int(input())
i = 0
def Right_Tri(m,n,o):
    a = (n**2+o**2)**(0.5)
    if m == a:
        return True

while(i<t):
    m,n,o = map(int, input().split())
    if (Right_Tri(m,n,o) or Right_Tri(n,o,m) or Right_Tri(o,m,n) == True):
        print("YES")
    else:
        print("NO")
    i += 1
Buggy python submission (verdict: Runtime Error):
import sys
import math

for line in sys.stdin:
    a, b = map(int, line.split(' '))
    gcd = math.gcd(a, b)
    print(gcd, a * b // gcd)

Fixed submission:
# Aizu - 0005
def De(a):
    res = []
    tmp = 2
    while a != 1:
        while not (a % tmp):
            a = round(a / tmp)
            res.append(tmp)
        tmp += 1
    return res

while True:
    try:
        tmp = input()
        a = [int(i) for i in tmp.split(' ')]
    except:
        break
    b = De(a[1])
    a = De(a[0])
    pa, pb = 0, 0
    GCD, LCM = 1, 1
    while True:
        if pa == len(a):
            for i in range(pb, len(b)):
                LCM *= b[i]
            break;
        if pb == len(b):
            for i in range(pa, len(a)):
                LCM *= a[i]
            break;
        if a[pa] == b[pb]:
            GCD *= a[pa]
            LCM *= a[pa]
            pa += 1
            pb += 1
            continue
        if a[pa] < b[pb]:
            LCM *= a[pa]
            pa += 1
            continue
        if a[pa] > b[pb]:
            LCM *= b[pb]
            pb += 1
            continue
    print('%d %d'%(GCD, LCM))
Buggy python submission (verdict: Runtime Error):
from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1))
	y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1))
	a=sqrt((x2-x1)**2+(y2-y1)**2)
	b=sqrt((x3-x1)**2+(y3-y1)**2)
	c=sqrt((x3-x2)**2+(y3-y2)**2)
	p=(a+b+c)/2
	S=sqrt(p*(p-a)*(p-b)*(p-c))
	R=a*b*c/4/S
	print"%.3f %.3f %.3f"%(x,y,R)

Fixed submission:
from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	A2=2*(x3-x2)
	B2=2*(y3-y2)
	C2=x3**2+y3**2-x2**2-y2**2
	x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
	y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
	R=sqrt((x1-x)**2+(y1-y)**2)
	print"%.3f %.3f %.3f"%(x,y,R)

Buggy python submission (verdict: Runtime Error):
from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1))
	y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1))

Fixed submission:
from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	A2=2*(x3-x2)
	B2=2*(y3-y2)
	C2=x3**2+y3**2-x2**2-y2**2
	x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
	y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
	R=sqrt((x1-x)**2+(y1-y)**2)
	print"%.3f %.3f %.3f"%(x,y,R)

Buggy python submission (verdict: Runtime Error):
from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	A2=2*(x3-x2)
    B2=2*(y3-y2)
    C2=x3**2+y3**2-x2**2-y2**2

Fixed submission:
from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	A2=2*(x3-x2)
	B2=2*(y3-y2)
	C2=x3**2+y3**2-x2**2-y2**2
	x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
	y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
	R=sqrt((x1-x)**2+(y1-y)**2)
	print"%.3f %.3f %.3f"%(x,y,R)
Buggy python submission (verdict: Runtime Error):
import sys 
import numpy as np 

def main():
    input_line = []
#     test_line = ['9 1 8 2', '4 1 5 9', '4 6 8 2', '4 6 3 2']
    
#     for line in test_line:
#         input_line.append(line.split())
    
    
    
    for line in sys.stdin:
        input_line.append(line.split())
    #print(input_line)

    
    for i in range(0,len(input_line),2):
        #hit number
        arrary1 = np.array(input_line[i], dtype=float)
        arrary2 = np.array(input_line[i+1], dtype=float)
        hit_vec = arrary1 - arrary2
        hit_list = list(hit_vec)
        hitnumber = hit_list.count(0.)
        #print(hit_list.count(0.))
        
        #blow number
        
        
        
        
        #get the hit location and remove
        hit_loc = [i for i,x in enumerate(hit_list) if x == 0]
        blow_vec1 = np.delete(arrary1, hit_loc)
        blow_vec2 = np.delete(arrary2, hit_loc)
        blownumber = len(set(blow_vec1).intersection(blow_vec2))
        #print(len(set(blow_vec1).intersection(blow_vec2)))
        
        print(hitnumber,blownumber)


        
if __name__ == '__main__':
    main()

Fixed submission:
while True:
	try:
		s1 = raw_input()
		s2 = raw_input()
		a = map(int, s1.split())
		b = map(int, s2.split())
		hashMap = {}
		hit = 0
		blow = 0
		for i in range(len(a)):
			hashMap[a[i]] = i
		for i in range(len(b)):
			if b[i] in hashMap:
				if hashMap[b[i]] == i:
					hit += 1
				else:
					blow += 1
		print '%s %s' % (hit, blow)
	except (EOFError):
		break
Buggy python submission (verdict: Runtime Error):
import sys 
def main():
    input_line = []
    test_line = 'Thank you for your mail and your lectures'
    
#     for line in test_line.split():
#         input_line.append(line)
        
    

    for line in sys.stdin:
        input_line.append(line.split())
    
    #print(input_line.count('your'))
    number_len = {}
    number_fre = {}
    for i in input_line: 
        number_len.update({i:len(i)})
        number_fre.update({i:test_line.count(i)})
        



        
if __name__ == '__main__':
    main()

Fixed submission:
from collections import Counter


def main():
    inp = input().strip().split(' ')

    k = Counter()

    maxlen = 0
    maxlenword = ''
    for z in inp:
        k[z] += 1

        if len(z) > maxlen:
            maxlenword = z
            maxlen = len(z)

    maxi = k.most_common(1)[0][0]

    print(maxi, maxlenword)

if __name__ == '__main__':
    main()

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

def main():
    
    input_line = []
#     with open('test_data') as f:
#         for line in f.readline().split():
#             input_line.append(line)
            
    for line in sys.stdin.readline().split():
        input_line.append(line)
    #print(input_line)
   
    number_len = {}
    number_fre = {}
    for i in input_line: 
        number_len.update({i:len(i)})
        number_fre.update({i:input_line.count(i)})
        
    sorted_x = sorted(number_len.items(), key=operator.itemgetter(1))
    sorted_y = sorted(number_fre.items(), key=operator.itemgetter(1))
    print(sorted_x[-1][0],sorted_y[-1][0])


        
if __name__ == '__main__':
    main()

Fixed submission:
from collections import Counter


def main():
    inp = input().strip().split(' ')

    k = Counter()

    maxlen = 0
    maxlenword = ''
    for z in inp:
        k[z] += 1

        if len(z) > maxlen:
            maxlenword = z
            maxlen = len(z)

    maxi = k.most_common(1)[0][0]

    print(maxi, maxlenword)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created: 木 11/ 9 19:01:14 2017

# Usage
#
"""
from itertools import accumulate

def data_req():
    n_yado, m_ryotei = [int(i) for i in input().split(" ")]
    yado_distance = []
    ryotei = []
    for _ in range(n_yado):
        yado_distance.append(int(input()))
    for _ in range(m_ryotei):
        ryotei.append(int(input()))

    return yado_distance, ryotei


def search(distance, ryotei):
    """search.

    >>> search([2, 1, 1, 3, 2, 1], [2, -1, 3, 2, -3])
    18
    """
    acc = [0] + list(accumulate(distance, lambda x, y: x+y))
    ryotei_index = [0] + list(accumulate(ryotei, lambda x, y: x+y))
    # print(ryotei_index)
    res = []
    for index in enumerate(ryotei_index):
        if index[0] == 0:
            continue
        index = index[0]
        # print(index)
        # print(ryotei_index[index])
        # print(ryotei_index[index - 1])
        dist = abs(acc[ryotei_index[index]] - acc[ryotei_index[index - 1]])
        res.append(dist)
        # print(sum(res))
    # his = []
    #
    # for index in range(len(ryotei_index)):
    #     his.append(acc[ryotei_index[index + 1]] - acc[ryotei_index[index]])
    #
    # return sum(his)
    return sum(res)


if __name__ == '__main__':
    dis, ryotei = data_req()
    search(dis, ryotei)

Fixed submission:
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created: 木 11/ 9 19:01:14 2017

# Usage
#
"""
from itertools import accumulate

def data_req():
    n_yado, m_ryotei = [int(i) for i in input().split(" ")]
    yado_distance = []
    ryotei = []
    for _ in range(n_yado - 1):
        yado_distance.append(int(input()))
    for _ in range(m_ryotei):
        ryotei.append(int(input()))

    return yado_distance, ryotei


def search(distance, ryotei):
    """search.

    >>> search([2, 1, 1, 3, 2, 1], [2, -1, 3, 2, -3])
    18
    """
    acc = [0] + list(accumulate(distance, lambda x, y: x+y))
    ryotei_index = [0] + list(accumulate(ryotei, lambda x, y: x+y))
    # print(ryotei_index)
    res = []
    for index in enumerate(ryotei_index):
        if index[0] == 0:
            continue
        index = index[0]
        # print(index)
        # print(ryotei_index[index])
        # print(ryotei_index[index - 1])
        dist = abs(acc[ryotei_index[index]] - acc[ryotei_index[index - 1]])
        res.append(dist)
        # print(sum(res))
    # his = []
    #
    # for index in range(len(ryotei_index)):
    #     his.append(acc[ryotei_index[index + 1]] - acc[ryotei_index[index]])
    #
    # return sum(his)
    return sum(res)


if __name__ == '__main__':
    dis, ryotei = data_req()
    print(search(dis, ryotei) % 100000)