Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for y in range(h):
  print('*'**w)

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w+'\n')*h)

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for y in range(h):
  ''join([*]**w)

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w+'\n')*h)

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for y in range(h):
  ''.join([*]**w)

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w+'\n')*h)

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for _ in range(h):
  print("".join([*]**w))
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w+'\n')*h)

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for _ in range(h):
  print("".join(['*']**w))
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w+'\n')*h)
Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print([#]*w)
 for _ in range(h-2):print("#".join(['.']*(w-2)))
 print([#]*w\n)

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print(['#']*w)
 for _ in range(h-2):print("#".join(['.']*(w-2)))
 print(['#']*w\n)

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print("".join(['#']*w))
 for _ in range(h-2):print("#".join(['.']*(w-2)))
 print("".join(['#']*w))|

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print("".join(['#']*w))
 for _ in range(h-2):print("#".join(['.']*(w-2)))
 print(f'{"".join(['#']*w)}\n')

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print("".join(['#']*w))
 for _ in range(h-2):print("#".join(['.']*(w-2)))
 print("".join(['#']*w))
 print(\n)

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print('#'*w)
 for _ in range(h-2):print('#'+'.'*(w-2)+'#'))
 print('#'*w)
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w))
 for _ in range(h-2):print(('#'+'.'*(w-2)+'#')))
 print(('#'*w))
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w))
 for _ in range(h-2):print('#'+'.'*(w-2)+'#'))
 print(('#'*w))
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 print(('#'*w)+'\n'+('#'+'.'*(w-2)+'#\n')*(h-2)+('#'*w)+'\n')
Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):
  x,y='#','.' if i%0==0 else '.','#'
  print("".join(zip([x]*(w+1)//2,[y]*w//2)))
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):print(('#.'*w)[i%2:][:w])
 print()

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):
  x,y=['#','.'] if i%0==0 else ['.','#']
  print("".join(zip([x]*(w+1)//2,[y]*w//2)))
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):print(('#.'*w)[i%2:][:w])
 print()

Buggy python submission (verdict: Runtime Error):
while True:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):
  x,y=['#','.'] if i%2==0 else ['.','#']
  print("".join(zip([x]*(w+1)//2,[y]*w//2)))
 print()

Fixed submission:
while 1:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):print(('#.'*w)[i%2:][:w])
 print()
Buggy python submission (verdict: Runtime Error):
for i in range(1,int(input)+1):
 a=i
 while(a>0):
  if a%3==0:
   print(i,end='')
   break
  a/=10

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
for i in range(1,int(input())+1):
 a=i
 while(a>0):
  if a%3==0 or a%10==3:
   print(' ',i,end=' ')
   break
  a/=10

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
for i in range(1,int(input())+1):
 a=i
 while(a>0):
  if a%3==0 or a%10==3:
   print(f' {i}',end=' ')
   break
  a/=10

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
for i in range(1,int(input())+1):
 a=i
 while(a>0):
  if a%3==0 or a%10==3:
   print(f' {i}',end='')
   break
  a/=10

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
for i in range(1,int(input())+1):
 if a%3==0
  if a%3==0 or a%10==3:
   print(f' {i}',end='')
   break

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
for i in range(1,int(input())+1):
 if a%3==0 or a%10==3:print(f' {i}',end='')

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(1,n+1):
 a=i
 m=[]
 if a%3==0:
  m.append(i)
  continue
 while a>0:
  if a%10==3:
   m.append(i)
   break
  a/=10
print(' '.join(m))

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
n=int(input())
m=[]
for i in range(1,n+1):
 a=i
 if a%3==0:
  m.append(i)
  continue
 while a>0:
  if a%10==3:
   m.append(i)
   break
  a/=10
print(' '+*m)

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
print(*['']+[i for i in range(3,int(input())+1)if i%3==0 or '3' in str(i)])

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
print(' '+*[i for i in range(3,int(input())+1)if i%3==0 or '3' in str(i)])

Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])

Buggy python submission (verdict: Runtime Error):
#include <iostream>

using namespace std;

int main(){
    int n;
    cin >> n;
    for (int i = 3; i <= n; i++) {
        if (i%3==0) cout << ' ' << i;
        else
        {
            int x = i;
            while (x) {
                if (x%10 == 3) {
                    cout << ' ' << i;
                    break;
                }
                x /= 10;
            }
        }
    }
    cout << endl;
    return 0;
}


Fixed submission:
print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])
Buggy python submission (verdict: Runtime Error):
e=[input()for _ in[0]*int(input())]
for s in"SHCD":
 for r in range(1,14):
  if f'{s} {r}'not in e:print(s,r)


Fixed submission:
input()
print(*input().split()[::-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
e=[input()for _ in[0]*n]
for s in"SHCD":
 for r in range(1,14):
  if f'{s} {r}'not in e:print(s,r)


Fixed submission:
input()
print(*input().split()[::-1])
Buggy python submission (verdict: Runtime Error):
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 print('#'*20)

Fixed submission:
a=[[10*[0]for _ in[0]*3]for _ in[0]*4]
for _ in[0]*int(input()):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):print('',*a[i][j])
 if i<3:print('#'*20)

Buggy python submission (verdict: Runtime Error):
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 print(('#'*20))

Fixed submission:
a=[[10*[0]for _ in[0]*3]for _ in[0]*4]
for _ in[0]*int(input()):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):print('',*a[i][j])
 if i<3:print('#'*20)

Buggy python submission (verdict: Runtime Error):
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 if i!=3:print('#'*20)

Fixed submission:
a=[[10*[0]for _ in[0]*3]for _ in[0]*4]
for _ in[0]*int(input()):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):print('',*a[i][j])
 if i<3:print('#'*20)

Buggy python submission (verdict: Runtime Error):
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 if i!=3:print('#'*20)

Fixed submission:
a=[[10*[0]for _ in[0]*3]for _ in[0]*4]
for _ in[0]*int(input()):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):print('',*a[i][j])
 if i<3:print('#'*20)

Buggy python submission (verdict: Runtime Error):
a=[[[0]*10]*3]*4
for _ in range(int(input())):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):
  print(' '.join(a[i][j]))
 if i!=3:print('#'*20)

Fixed submission:
a=[[10*[0]for _ in[0]*3]for _ in[0]*4]
for _ in[0]*int(input()):
 b,f,r,v=map(int,input().split())
 a[b-1][f-1][r-1]+=v
for i in range(4):
 for j in range(3):print('',*a[i][j])
 if i<3:print('#'*20)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
A=[input().split()for _ in[0]*n]
b=[input()for _ in[0]*m]
for a in A:print(sum(x*y for x,y in map(int,zip(a,b))))


Fixed submission:
n,m=map(int,input().split())
A=[input().split()for _ in[0]*n]
b=[input()for _ in[0]*m]
for a in A:print(sum(int(x)*int(y)for x,y in zip(a,b)))
Buggy python submission (verdict: Runtime Error):
while 1:
 m,f,r=map(int,input().split());s=m+f
 if m*f<-1:break
 if m==-1 or f==-1 or s<30:print('F')
 elif s>79:print('A')
 elif s>64:print('B')
 elif s>49 or r>49:print('C')
 else:print('D')

Fixed submission:
while 1:
 m,f,r=map(int,input().split());s=m+f
 if r<0>s:break
 print('F'if(m*f<0)+(s<30)else'D'if s<50>r else'C'if s<65 else'B'if s<80 else'A')
Buggy python submission (verdict: Runtime Error):
while 1:
 n,x=map(int,input().split())
 if n+x==0:break
 for i in range(3,n+1):
  for j in range(2,x-i):
   if x-i-j<j<i:
    c+=1
 print(c)

Fixed submission:
from itertools import combinations
while 1:
 n,m=map(int,input().split())
 if n==m==0:break
 print(sum(1 for p in combinations(range(1,n+1),3)if sum(p)==m))

Buggy python submission (verdict: Runtime Error):
while 1:
 n,x=map(int,input().split())
 if n+x==0:break
 print(sum([1 for j in range(2,x-i)for i in range(3,n+1)if x-i-j<j<i]))

Fixed submission:
from itertools import combinations
while 1:
 n,m=map(int,input().split())
 if n==m==0:break
 print(sum(1 for p in combinations(range(1,n+1),3)if sum(p)==m))
Buggy python submission (verdict: Runtime Error):
        while 1:
            x=sum(map(int,list(input())))
            if x==0:break
            print(x)

Fixed submission:
for x in iter(input,'0'):print(sum(map(int,x)))
Buggy python submission (verdict: Runtime Error):
while 1:
 a=list(input().lower())
 [print(chr(97+i),':',a.count(chr(97+i)))for i in range(26)]
 if'.'in a:break

Fixed submission:
import sys;s=sys.stdin.read().lower()
for c in map(chr,range(97,123)):print(c,':',s.count(c))
Buggy python submission (verdict: Runtime Error):
W=input()
T=''
while 1:
 a=input()
 if'END_OF_TEXT'!=a:T+=a'
 else:break
 T+=' '
print(T.count(W))

Fixed submission:
import sys
W=input()
print(sys.stdin.read().lower().split().count(W))

Buggy python submission (verdict: Runtime Error):
W=input().lower()
T=''
while 1:
 a=input().lower()+' '
 if'END_OF_TEXT '==a:break
 T+=a
print(T.count(W))

Fixed submission:
import sys
W=input()
print(sys.stdin.read().lower().split().count(W))

Buggy python submission (verdict: Runtime Error):
W=input()
T=''
while 1:
 a=input()
 if'END_OF_TEXT '==a:break
 T+=a.lower()
print(T.count(W))

Fixed submission:
import sys
W=input()
print(sys.stdin.read().lower().split().count(W))

Buggy python submission (verdict: Runtime Error):
W=input()
T=''
while 1:
 a=input()
 if'END_OF_TEXT '==a:break
 T+=[s.lower() for s in a.split()]
print(T.count(W))

Fixed submission:
import sys
W=input()
print(sys.stdin.read().lower().split().count(W))

Buggy python submission (verdict: Runtime Error):
W=input()
T=[]
while 1:
 a=input()
 if'END_OF_TEXT '==a:break
 T+=[s.lower() for s in a.split()]
print(T.count(W))

Fixed submission:
import sys
W=input()
print(sys.stdin.read().lower().split().count(W))

Buggy python submission (verdict: Runtime Error):
while 1:
 s=input()
 if'-'==s:break
 n=sum([int(input())for _ in range(int(input()))])%len(s)
 print(s[n:]+s[:n])

Fixed submission:
import sys
W=input()
print(sys.stdin.read().lower().split().count(W))
Buggy python submission (verdict: Runtime Error):
while 1:
 a=input()
 if a.isdigit():
  if c>0:c+=int(a)
  else:c=1
 else:
  if c!=0:print((s*2)[c%l-1:][:l])
  if'-'==a:break
  s=a;l=len(s);c=0

Fixed submission:
for s in iter(input,'-'):
 for _ in[0]*int(input()):
  n=int(input())
  s=s[n:]+s[:n]
 print(s)
Buggy python submission (verdict: Runtime Error):
s=input()
for _ in range(int(input())):
 a=input().split()
 o=a[0];i=int(a[1]);j=int(a[2])+1
 if'p'==o[0]:print(s[i:j])
 else:
  t=(s[i:j][::-1],a[3])['p'==o[2]]
  s=s[0:i]+t+s[j:]


Fixed submission:
s=input()
for _ in[0]*int(input()):
 a=input().split()
 o=a[0];i,j=map(int,a[1:3]);j+=1
 if'p'==o[0]:print(s[i:j])
 else:s=s[:i]+(a[3]if'p'==o[2]else s[i:j][::-1])+s[j:]
Buggy python submission (verdict: Time Limit Exceeded):
m=input();n=int(m);a=[];i=6
while n%2==0:a+=[2];n//=2
while n%3==0:a+=[3];n//=3
while i<n+2:
 if n%(i-1)==0:a+=[i-1];n//=i-1
 elif n%(i+1)==0:a+=[i+1];n//=i+1
 else:i+=6
print(m+':',*a)


Fixed submission:
p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
m=input();n=int(m);s=n/2;a=[];i=6
while n%2==0:a+=[2];n//=2
while n%3==0:a+=[3];n//=3
while i<s:
 if n%(i-1)==0:a+=[i-1];n//=i-1
 elif n%(i+1)==0:a+=[i+1];n//=i+1
 else:i+=6
if n==int(m):a+=[m]
print(m+':',*a)


Fixed submission:
p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
m=input();n=int(m);a=[];i=6
while n%2==0:a+=[2];n//=2
while n%3==0:a+=[3];n//=3
while i<int(m):
 if n%(i-1)==0:a+=[i-1];n//=i-1
 elif n%(i+1)==0:a+=[i+1];n//=i+1
 else:i+=6
if n==int(m):a+=[m]
print(m+':',*a)


Fixed submission:
p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
p=lambda x:print(x,end=' ')
n=input()
p(n+':')
n=int(n)
while n%2==0 and n>3:
    p(2)
    n//=2
d=3
while n>d+1:
    if n%d==0:
        p(d)
        n//=d
    else:d+=2
print(n)


Fixed submission:
p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
p=lambda x:print(x,end=' ')
n=input()
p(n+':')
n=int(n);s=n**.5
while n%2==0 and n>3:
    p(2)
    n//=2
d=3
while n>d+1:
    if s>d and n%d==0:
        p(d)
        n//=d
    else:d+=2
print(n)


Fixed submission:
p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)

Buggy python submission (verdict: Runtime Error):
p=lambda x:print(x,end=' ')
n=input():p(n+':')
n=int(n);s=n**.5
while n%2==0 and n>3:p(2);n//=2
d=3
while s>d and n>d:
 if n%d==0:p(d);n//=d
 else:d+=2
print(n)


Fixed submission:
p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)

Buggy python submission (verdict: Runtime Error):
p=lambda x:print(x,end=' ')
m=n=input();p(n+':')
n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)


Fixed submission:
p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)
Buggy python submission (verdict: Runtime Error):
import math
print(math.pow(map(int,input())))


Fixed submission:
print(int(pow(*map(int,input().split()),10**9+7)))
Buggy python submission (verdict: Runtime Error):
p=1;a=[]
n=int(input());s=n**.5
while n%2==0 and n>3:a+=[2];n//=2
d=3
while s>d and n>d:
 if n%d==0:a+=[d];n//=d
 else:d+=2
a+=[n]
for f in set(a):
 p*=f**a.count(f)*(1-1/f)
print(int(p)


Fixed submission:
p=n=int(input())
d=2
while d*d<=n:
 if n%d==0:
  p=p*(d-1)//d
  while n%d==0:n//=d
 d+=1
print([p,p*(n-1)//n][n>1])
Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b=map(int,input().split())
c=math.gcd(a,b)
for x in range(b):
 y=(c-a*x)/b
 if int(y)==y:break
f=lambda x,y:abs(x)+abs(y)
if f(x,y)<f(-b+x,a+y):
 print(x,int(y))
else:
 print(-b+x,int(a+y))


Fixed submission:
r,s=map(int,input().split())
a=d=1;b=c=0
while s:q=r//s;r,s,a,c,b,d=s,r%s,c,a-q*c,d,b-q*d
print(a,b)

Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b=map(int,input().split())
c=math.gcd(a,b)
for x in range(b):
 y=(c-a*x)/b
 if int(y)==y:break
f=lambda x,y:abs(x)+abs(y)
if f(x,y)<f(-b+x,a+y):
 print(x,int(y))
else:
 print(-b+x,int(a+y))


Fixed submission:
r,s=map(int,input().split())
a=d=1;b=c=0
while s:q=r//s;r,s,a,c,b,d=s,r%s,c,a-q*c,d,b-q*d
print(a,b)

Buggy python submission (verdict: Runtime Error):
r,s=map(int,input().split())
a=d=1,b=c=0
while r:q=r//s;r,s,a,c,b,d=s,r%s,c,a-q*c,d,b-q*d
print(a,b)


Fixed submission:
r,s=map(int,input().split())
a=d=1;b=c=0
while s:q=r//s;r,s,a,c,b,d=s,r%s,c,a-q*c,d,b-q*d
print(a,b)

Buggy python submission (verdict: Runtime Error):
r,s=map(int,input().split())
a=d=1,b=c=0
while r:
 q=r//s
 r,s,a,c,b,d=s,r%s,c,a-q*c,d,b-q*d
print(a,b)


Fixed submission:
r,s=map(int,input().split())
a=d=1;b=c=0
while s:q=r//s;r,s,a,c,b,d=s,r%s,c,a-q*c,d,b-q*d
print(a,b)
Buggy python submission (verdict: Runtime Error):
import numpy as np
while True:
    num = int(input())
    if num == 0:
        break
    data = np.array(list(map(int, input().split())))
    print(np.std(data))


Fixed submission:
while True:
    num = int(input())
    if num == 0:
        break
    data = list(map(int, input().split()))
    datasqr = [i ** 2 for i in data]
    print("%lf" % (sum(datasqr) / num - (sum(data) / num) ** 2) ** 0.5)
Buggy python submission (verdict: Runtime Error):
sec = int(input())
tmp = [sec // 3600, (sec // 60) % 60, sec % 60]
print(':'.join(tmp))


Fixed submission:
sec = int(input())
tmp = map(str, [sec // 3600, (sec // 60) % 60, sec % 60])
print(':'.join(tmp))
Buggy python submission (verdict: Runtime Error):
num = map(int, input().split(' '))
num.sort()
print(' '.join(map(int, num)))


Fixed submission:
num = list(map(int, input().split(' ')))
num.sort()
print(' '.join(map(str, num)))

Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split(' ')))
num.sort()
print(' '.join(map(int, num)))


Fixed submission:
num = list(map(int, input().split(' ')))
num.sort()
print(' '.join(map(str, num)))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
for line in stdin:
	if line == '0 ? 0':
		break
	tmp = line.strip('\n').split(' ')
	a, b = int(tmp[0]), int(tmp[-1])
	if tmp[1] == '+':
		print(a + b)
	elif tmp[1] == '-':
		print(a - b)
	elif tmp[1] == '*':
		print(a * b)
	elif tmp[1] == '/':
		print(a // b)



Fixed submission:
from sys import stdin
for line in stdin:
	tmp = line.strip('\n').split(' ')
	a, b = int(tmp[0]), int(tmp[-1])
	if tmp[1] == '+':
		print(a + b)
	elif tmp[1] == '-':
		print(a - b)
	elif tmp[1] == '*':
		print(a * b)
	elif tmp[1] == '/':
		print(a // b)
	else:
		break
Buggy python submission (verdict: Runtime Error):
a, b = [int(i) for i in input().split()])
print(a-b)


Fixed submission:
a, b = [int(i) for i in input().split()]
print(a-b)
Buggy python submission (verdict: Runtime Error):
while 1:
    a, b = map(int, input().split())
    print(len(str(a+b)))


Fixed submission:
while 1:
    try:
        print(len(str(sum(map(int, input().split())))))
    except:
        break
Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, input().split())
print("{:.8f}".format(math.sqrt((x2-x1)**2 + (y2-y1)**2)))


Fixed submission:
x1, y1, x2, y2 = map(float, input().split())
print("{:.5f}".format(((x2-x1)**2 + (y2-y1)**2)**0.5))

Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(float, input().split())
print("{:4f}".format((x2-x1)**2 + (y2-y1)**2)**0.5)


Fixed submission:
x1, y1, x2, y2 = map(float, input().split())
print("{:.5f}".format(((x2-x1)**2 + (y2-y1)**2)**0.5))
Buggy python submission (verdict: Runtime Error):
while True:
    x = int(input())
    if x == 0:
            break
    print('Case {}: {}'.format(i, x))
    i += 1

Fixed submission:
i = 1
while True:
    x = input()
    if x == "0":
        break
    else:
        print("Case {}: {}".format(i, x))
        i += 1

Buggy python submission (verdict: Runtime Error):
while True:
    x = int(input())
    if x == 0:
            break
    print('Case {}: {}'.format(i, x))
    i += 1

Fixed submission:
i = 1
while True:
    x = input()
    if x == "0":
        break
    else:
        print("Case {}: {}".format(i, x))
        i += 1
Buggy python submission (verdict: Runtime Error):
import sympy as sym

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

c_divisors_list = sym.divisors(c)
result = []
for c_divisor in c_divisors_list:
    if c_divisor < a or c_divisor > b:
        pass
    else:
        result.append(c_divisor)

print(len(result))





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

count = 0
for i in range(a, b + 1):
    if c % i == 0:
        count += 1

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

r = int(input())
circle = r * 2 * math.pi
area = (r ** 2) * math.pi

print('{0:.5f} {1:.5f}'.format(area, circle))

Fixed submission:
import math
r = float(input())
print("{:.6f} {:.6f}".format(r**2 * math.pi, r*2.0 * math.pi))

Buggy python submission (verdict: Runtime Error):
r = int(input())
pi = 3.141592653589
print("{:.5f} {:.5f}".format(r ** 2 * pi, 2 * r * pi))


Fixed submission:
import math
r = float(input())
print("{:.6f} {:.6f}".format(r**2 * math.pi, r*2.0 * math.pi))

Buggy python submission (verdict: Runtime Error):
r = int(input())
pi = 3.141592653589
print("{:.10f} {:.10f}".format(r ** 2 * pi, 2 * r * pi))


Fixed submission:
import math
r = float(input())
print("{:.6f} {:.6f}".format(r**2 * math.pi, r*2.0 * math.pi))