Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = input()
nums = input()
nums = nums.split()
print(' '.join(map(str, nums)))

def bubble_sort(c, n):
    for i in range(n-1):
        for j in range(n-1):
            if c[j] > c[j+1]:
                c[j], c[j+1] = c[j+1], c[j]
    return c

def selection_sort(c, n):
    for i in range((n):
        mink = i
        for v in range(i, n):
            if c[v] <c[mink]:
                mink = v
        if mink != i:
            c[i], c[mink] = c[mink], c[i]
    return c

def is_stable(bs, ss):
    if bs == ss:
        return 'Stable'
    else:
        return 'Not stable'

bs = bubble_sort(nums, int(n))
print(' '.join(bs))
print('Stable')
ss = selection_sort(nums, int(n))
print(' '.join(ss))
print(is_stable(bs, ss))


Fixed submission:
class Card(object):
    def __init__(self, card):
        self.suit = card[:1]
        self.value = int(card[1:])
    
    def __str__(self):
        return self.suit + str(self.value)

def is_stable(bs, ss):
    if bs == ss:
        return 'Stable'
    else:
        return 'Not stable'

def bubble_sort(c, n):
    c = c.split()
    c = [Card(card) for card in c]
    for i in range(n-1):
        for j in range(n-1):
            if c[j].value > c[j+1].value:
                c[j], c[j+1] = c[j+1], c[j]
    return c

def selection_sort(c, n):
    c = c.split()
    c = [Card(card) for card in c]
    for i in range(n):
        mink = i
        for v in range(i, n):
            if c[v].value < c[mink].value:
                mink = v
        if mink != i:
            c[i], c[mink] = c[mink], c[i]
    return c

n = input()
nums = input()

bs = bubble_sort(nums, int(n))
bs_str = [str(card) for card in bs]
print(' '.join(bs_str))
print('Stable')

ss = selection_sort(nums, int(n))
ss_str = [str(card) for card in ss]
print(' '.join(ss_str))
print(is_stable(bs_str, ss_str))
Buggy python submission (verdict: Runtime Error):
def get(num):
    n=0
    is_prime=[0]*200050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    try:
        a=map(int,raw_input().strip().split())
        b=a[0]
        if(b==0):
            break
        p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
        print(p)
    except EOFError:
        break



Fixed submission:
def get(num):
    n=0
    is_prime=[0]*300050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    a=map(int,raw_input().strip().split())
    b=a[0]
    if(b==0):
        break
    p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
    print(p)

Buggy python submission (verdict: Runtime Error):
def get(num):
    n=0
    is_prime=[0]*200050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    a=map(int,raw_input().strip().split())
    b=a[0]
    if(b==0):
        break
    p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
    print(p)



Fixed submission:
def get(num):
    n=0
    is_prime=[0]*300050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    a=map(int,raw_input().strip().split())
    b=a[0]
    if(b==0):
        break
    p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
    print(p)

Buggy python submission (verdict: Runtime Error):
while True:
    a, b = map(int, raw_input().strip().split())
    if a == 0 and b == 0:
        break
    print a + b,


Fixed submission:
def get(num):
    n=0
    is_prime=[0]*300050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    a=map(int,raw_input().strip().split())
    b=a[0]
    if(b==0):
        break
    p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
    print(p)
Buggy python submission (verdict: Runtime Error):
import math
p = math.pi
r = int(input())

print("{} {}",format(2*r*p, r*r*p))



Fixed submission:
import math
p = math.pi
r = float(input())

print("{} {}".format(r*r*p, 2*r*p))
Buggy python submission (verdict: Runtime Error):
a = int(input())
for i in range(1,a+3):
    if i % 3 == 0 or i % 10 == 3 or (int(i/10) % 3 == 0 and int(i/10) != 0:
        print(" {}".format(i), end = "")
    elif i % 10 == 3:
        print(" {}".format(i), end = "")
print()




Fixed submission:
a = int(input())
for i in range(1,a+1):
    x = i
    if i % 3 == 0 or i % 10 == 3:
        print(" {}".format(i), end = "")
    else:
        while int(x) > 0:
            x /= 10
            if int(x) % 10 == 3:
                print(" {}".format(i), end = "")
                break
print()

Buggy python submission (verdict: Runtime Error):
a = int(input())
for i in range(1,a+1):
    if i % 3 == 0 or i % 10 == 3:
        print(" {}".format(i), end = "")
    else:
        while x < 0:
            int(x/=10)
            if x % 10 == 3:
                print(" {}".format(i), end = "")

print()


Fixed submission:
a = int(input())
for i in range(1,a+1):
    x = i
    if i % 3 == 0 or i % 10 == 3:
        print(" {}".format(i), end = "")
    else:
        while int(x) > 0:
            x /= 10
            if int(x) % 10 == 3:
                print(" {}".format(i), end = "")
                break
print()
Buggy python submission (verdict: Runtime Error):
class Queue():
    def __init__(self, size=10):
        self.queue = [None] * size
        self.head = self.tail = 0
        self.MAX = size
        self.num_items = 0

    def is_empty(self):
        return self.num_items == 0

    def is_full(self):
        return self.num_items == self.MAX

    def enqueue(self, x):
        if self.is_full():
            raise IndexError

        self.queue[self.tail] = x
        self.num_items += 1
        if self.tail+1 == self.MAX:
            self.tail = 0
        else:
            self.tail += 1

    def dequeue(self):
        if self.is_empty():
            raise IndexError

        x = self.queue[self.head]
        self.num_items -= 1
        if self.head+1 == self.MAX:
            self.head = 0
        else:
            self.head += 1

        return x


class Process:
    def __init__(self, name, time):
        self.name = name
        self.time = time

    def print_time(self):
        return self.time

    def print_name(self):
        return self.name


def main():
    n, q = map(int, input().split())
    qq = Queue()

    t = 0
    for i in range(n):
        name, time = input().split()
        p = Process(name, int(time))
        qq.enqueue(p)

    while not qq.is_empty():
        p = qq.dequeue()

        if p.time - q <= 0:
            t += p.time
            print("{} {}".format(p.name, t))
        else:
            p.time -= q
            t += q
            qq.enqueue(p)


if __name__ == '__main__':
    main()



Fixed submission:
class Queue():
    def __init__(self, size=10):
        self.queue = [None] * size
        self.head = self.tail = 0
        self.MAX = size
        self.num_items = 0

    def is_empty(self):
        return self.num_items == 0

    def is_full(self):
        return self.num_items == self.MAX

    def enqueue(self, x):
        if self.is_full():
            raise IndexError

        self.queue[self.tail] = x
        self.num_items += 1
        if self.tail+1 == self.MAX:
            self.tail = 0
        else:
            self.tail += 1

    def dequeue(self):
        if self.is_empty():
            raise IndexError

        x = self.queue[self.head]
        self.num_items -= 1
        if self.head+1 == self.MAX:
            self.head = 0
        else:
            self.head += 1

        return x


class Process:
    def __init__(self, name, time):
        self.name = name
        self.time = time

    def print_time(self):
        return self.time

    def print_name(self):
        return self.name


def main():
    n, q = map(int, input().split())
    qq = Queue(n)

    t = 0
    for i in range(n):
        name, time = input().split()
        p = Process(name, int(time))
        qq.enqueue(p)

    while not qq.is_empty():
        p = qq.dequeue()

        if p.time - q <= 0:
            t += p.time
            print("{} {}".format(p.name, t))
        else:
            p.time -= q
            t += q
            qq.enqueue(p)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
M = 10 ** 6 + 3
HASH_MAP = [None for i in range(M)]


def hash1(key):
    return key % M


def hash2(key):
    return 1 + (key % M-1)


def my_hash(key, i):
    return (hash1(key)+i*hash2(key)) % M


def make_num(s):
    return len(s) + ord(s[0])


def insert(key):
    i = 0
    key_n = make_num(key)
    while True:
        j = my_hash(key_n, i)
        if HASH_MAP[j] is None:
            HASH_MAP[j] = key
            return j

        i += 1


def search(key):
    i = 0
    key_n = make_num(key)
    while True:
        j = my_hash(key_n, i)
        if HASH_MAP[j] == key:
            return j
        elif HASH_MAP[j] is None or i >= M:
            return None

        i += 1


def main():
    n = int(input())

    for i in range(n):
        order = input().split()
        if order[0] == "insert":
            insert(order[1])
        else:
            if search(order[1]) is None:
                print("no")
            else:
                print("yes")


if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n = int(input())

    s_set = set()
    for i in range(n):
        order = input().split()
        if order[0] == "insert":
            s_set.add(order[1])
        else:
            if order[1] in s_set:
                print("yes")
            else:
                print("no")


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
M = 10 ** 6 + 3
HASH_MAP = [None for i in range(M)]


def hash1(key):
    return key % M


def hash2(key):
    return 1 + (key % M-1)


def my_hash(key, i):
    return (hash1(key)+i*hash2(key)) % M


def make_num(s):
    return len(s) + ord(s[0]) + ord(s[-1])


def insert(key):
    i = 0
    key_n = make_num(key)
    while True:
        j = my_hash(key_n, i)
        if HASH_MAP[j] is None:
            HASH_MAP[j] = key
            return j

        i += 1


def search(key):
    i = 0
    key_n = make_num(key)
    while True:
        j = my_hash(key_n, i)
        if HASH_MAP[j] == key:
            return j
        elif HASH_MAP[j] is None or i >= M:
            return None

        i += 1


def main():
    n = int(input())

    for i in range(n):
        order = input().split()
        if order[0] == "insert":
            insert(order[1])
        else:
            if search(order[1]) is None:
                print("no")
            else:
                print("yes")


if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n = int(input())

    s_set = set()
    for i in range(n):
        order = input().split()
        if order[0] == "insert":
            s_set.add(order[1])
        else:
            if order[1] in s_set:
                print("yes")
            else:
                print("no")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))


def make_m(i, m):
    if m == 0:
        return True
    if i >= N or m < 0:
        return False

    return make_m(i+1, m) or make_m(i+1, m-A[i])


def main():
    q = int(input())
    m_lst = list(map(int, input().split()))

    for i in range(q):
        if make_m(0, m_lst[i]):
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    main()



Fixed submission:
N = int(input())
A = list(map(int, input().split()))
M_DICT = {}


def make_m(i, m):
    if (i, m) in M_DICT:
        return M_DICT[(i, m)]
    if m == 0:
        return True
    if i >= N or m < 0:
        return False

    res = make_m(i+1, m) or make_m(i+1, m-A[i])
    M_DICT[(i, m)] = res
    return res


def main():
    q = int(input())
    m_lst = list(map(int, input().split()))

    for i in range(q):
        if make_m(0, m_lst[i]):
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import bisect

INF = 1 << 20


def main():
    n = int(input())
    a = [int(input()) for i in range(n)]

    dp = [INF for i in range(n+1)]
    for i in range(1, n+1):
        idx = bisect.bisect_left(dp, a[i-1])
        dp[idx] = a[i-1]

    ans = bisect.bisect_left(dp, INF)
    print(ans)


if __name__ == '__main__':
    main()



Fixed submission:
import bisect

INF = 1 << 30


def main():
    n = int(input())
    a = [int(input()) for i in range(n)]

    dp = [INF for i in range(n+1)]
    for i in range(1, n+1):
        idx = bisect.bisect_left(dp, a[i-1])
        dp[idx] = a[i-1]

    ans = bisect.bisect_left(dp, INF)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
data = list(map(int, input().split()))
print(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5)


Fixed submission:
data = list(map(float, input().split()))
print(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5)

Buggy python submission (verdict: Runtime Error):
data = list(map(int, input().split()))
print(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5)


Fixed submission:
data = list(map(float, input().split()))
print(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5)

Buggy python submission (verdict: Runtime Error):
data = list(map(int, input().split()))
print("{:.8f}".format(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5))



Fixed submission:
data = list(map(float, input().split()))
print(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5)
Buggy python submission (verdict: Runtime Error):
class Dice:
    def __init__(self, top, dside):
        self.top = top
        self.dside = dside
        self.rside = None
        self.num = [self.top, self.dside, 7-self.top, 7-self.dside]
    def rside_num(self):
        if 2 in self.num and 3 in self.num:
            if(self.num.index(3)==self.num.index(2)+1 or 
                self.num==[3, 5, 4, 2]):
                self.rside = 1
            else:
                self.rside = 6
        elif 1 in self.num and 4 in self.num:
            if(self.num.index(4)==self.num.index(1)+1 or 
                self.num==[3, 6, 4, 1]):
                self.rside = 2
            else:
                self.rside = 5
        else:
            if(self.num.index(2)==self.num.index(1)+1 or
                self.num==[2, 6, 5, 1]):
                self.rside = 3
            else:
                self.rside = 4

num = list(map(int, input().split()))
n = int(input())
for i in range(n):
    value = list(map(int, input().split()))
    dice = Dice((num.index(value[0])+1), (num.index(value[1]+1)))
    dice.rside_num()
    print(dice.rside)



Fixed submission:
class Dice:
    def __init__(self, top, dside):
        self.top = top
        self.dside = dside
        self.rside = None
        self.num = [self.top, self.dside, 7-self.top, 7-self.dside]
    def rside_num(self):
        if 2 in self.num and 3 in self.num:
            if(self.num.index(3)==self.num.index(2)+1 or 
                self.num==[3, 5, 4, 2]):
                self.rside = 1
            else:
                self.rside = 6
        elif 1 in self.num and 4 in self.num:
            if(self.num.index(4)==self.num.index(1)+1 or 
                self.num==[4, 6, 3, 1]):
                self.rside = 2
            else:
                self.rside = 5
        else:
            if(self.num.index(2)==self.num.index(1)+1 or
                self.num==[2, 6, 5, 1]):
                self.rside = 3
            else:
                self.rside = 4

num = list(map(int, input().split()))
n = int(input())
for i in range(n):
    value = list(map(int, input().split()))
    dice = Dice(num.index(value[0])+1, num.index(value[1])+1)
    dice.rside_num()
    print(num[dice.rside-1])
Buggy python submission (verdict: Runtime Error):
int(x)
print(x**3)

Fixed submission:
x = input()
x = int(x)
print(x**3)
Buggy python submission (verdict: Runtime Error):
x = input()
x = x.split()
s = x[1] * x[2]
l = s * (x[1] + x[2])
print(s, l)

Fixed submission:
x = input().split(" ")
a = int(x[0])
b = int(x[1])
s = a*b
l = 2*(a+b)
print(s, l)

Buggy python submission (verdict: Runtime Error):
x = list(input().split)
print(x[1]*x[2], 2*(x[1]+x[2]))

Fixed submission:
x = input().split(" ")
a = int(x[0])
b = int(x[1])
s = a*b
l = 2*(a+b)
print(s, l)

Buggy python submission (verdict: Runtime Error):
x = list(input().split())
s = x[0]*x[1]
l = 2*(x[0]+x[1])
print(s, l)

Fixed submission:
x = input().split(" ")
a = int(x[0])
b = int(x[1])
s = a*b
l = 2*(a+b)
print(s, l)
Buggy python submission (verdict: Runtime Error):
t = input()
h = t // 3600
m = (t % 3600) // 60
s = t-3600*h-60*m
print(h, ":", m, ":", s)

Fixed submission:
S = int(input())
h = S//3600
m = (S % 3600) // 60
s = S-3600*h-60*m
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
S = int(input())
h = int(S / 3600)
m = int((S % 3600) / 60)
s = S-3600*h-60*m
print(str(h)+":"+str(m)+":"str(s))

Fixed submission:
S = int(input())
h = S//3600
m = (S % 3600) // 60
s = S-3600*h-60*m
print(str(h)+":"+str(m)+":"+str(s))
Buggy python submission (verdict: Runtime Error):
l1 = list(input().split(" "))
l2 = list(input().split(" "))
l1.sort()
if l1 == l2:
    print("Yes")
else:
    print("No")

Fixed submission:
l1 = list(input().split(" "))
a = int(l1[0])
b = int(l1[1])
c = int(l1[2])
if a<b:
    if b<c:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from math import pi
r = int(input())
print(pi*r**2, 2*pi*r)

Fixed submission:
from math import pi
r = float(input())
print(pi*r**2, 2*pi*r)

Buggy python submission (verdict: Runtime Error):
from math import pi
r = int(input())
print(pi*r**2, 2*pi*r)

Fixed submission:
from math import pi
r = float(input())
print(pi*r**2, 2*pi*r)
Buggy python submission (verdict: Runtime Error):
n = int(input())
spade = hart = club = diamond = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
trump = [spade, hart, club, diamond]
suit_def = ['S', 'H', 'C', 'D']

for i in range(n):
    card = list(input().split())
    suit = card[0]
    number = int(card[1])
    if suit == 'S':
        spade.remove(number)
    elif suit == 'H':
        hart.remove(number)
    elif suit == 'C':
        club.remove(number)
    elif suit == 'D':
        diamond.remove(number)

for i, j in zip(trump, suit_def):
    for k in i:
        print(j, k)

Fixed submission:
n = int(input())
spade = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
hart = set(spade)
club = set(spade)
diamond = set(spade)
trump = [spade, hart, club, diamond]
suit_def = ['S', 'H', 'C', 'D']

for i in range(n):
    card = list(input().split())
    suit = card[0]
    number = int(card[1])
    if suit == 'S':
        spade.remove(number)
    elif suit == 'H':
        hart.remove(number)
    elif suit == 'C':
        club.remove(number)
    else:
        diamond.remove(number)

for i, j in zip(trump, suit_def):
    for k in i:
        print(j, k)

Buggy python submission (verdict: Runtime Error):
n = int(input())
spade = hart = club = diamond = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
trump = [spade, hart, club, diamond]
suit_def = ['S', 'H', 'C', 'D']

for i in range(n):
    card = list(input().split())
    suit = card[0]
    number = int(card[1])
    if suit == 'S':
        spade.remove(number)
    elif suit == 'H':
        hart.remove(number)
    elif suit == 'C':
        club.remove(number)
    elif suit == 'D':
        diamond.remove(number)

for i, j in zip(trump, suit_def):
    for k in i:
        print(j, k)

Fixed submission:
n = int(input())
spade = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
hart = set(spade)
club = set(spade)
diamond = set(spade)
trump = [spade, hart, club, diamond]
suit_def = ['S', 'H', 'C', 'D']

for i in range(n):
    card = list(input().split())
    suit = card[0]
    number = int(card[1])
    if suit == 'S':
        spade.remove(number)
    elif suit == 'H':
        hart.remove(number)
    elif suit == 'C':
        club.remove(number)
    else:
        diamond.remove(number)

for i, j in zip(trump, suit_def):
    for k in i:
        print(j, k)
Buggy python submission (verdict: Runtime Error):
tr_in = input()
print(str_in.swapcase())


Fixed submission:
str_in = input()
print(str_in.swapcase())
Buggy python submission (verdict: Runtime Error):
char_list = []
while(True):
    str_in = input()
    if str_in=="":
        break
    char_list.append([i for i in str_in.lower()])
char_dict = {i:0 for i in "abcdefghijklmnopqrstuvwxyz"}
for i in range(len(char_list)):
    for j in char_list[i]:
        if j in char_dict:
            char_dict[j] += 1
for i in char_dict:
    print(i+" : {0}".format(char_dict[i]))



Fixed submission:
import sys

char_list = []
for line in sys.stdin:
    char_list.append([j for j in line.lower()])
char_dict = {i:0 for i in "abcdefghijklmnopqrstuvwxyz"}
for i in range(len(char_list)):
    for j in char_list[i]:
        if j in char_dict:
            char_dict[j] += 1
for i in char_dict:
    print(i+" : {0}".format(char_dict[i]))

Buggy python submission (verdict: Runtime Error):
#! usr/bin/env python
# coding: utf-8

char_list = []
while(True):
    str_in = input()
    if str_in=="":
        break
    char_list.append([i for i in str_in.lower()])
# print(char_list)
char_dict = {i:0 for i in "abcdefghijklmnopqrstuvwxyz"}
for i in range(len(char_list)):
    for j in char_list[i]:
        if j in char_dict:
            char_dict[j] += 1
# print(char_dict)
for i in char_dict:
    print(i+" : {0}".format(char_dict[i]))



Fixed submission:
import sys

char_list = []
for line in sys.stdin:
    char_list.append([j for j in line.lower()])
char_dict = {i:0 for i in "abcdefghijklmnopqrstuvwxyz"}
for i in range(len(char_list)):
    for j in char_list[i]:
        if j in char_dict:
            char_dict[j] += 1
for i in char_dict:
    print(i+" : {0}".format(char_dict[i]))
Buggy python submission (verdict: Runtime Error):
import numpy as np
while True:
    num = int(input())
    if num == 0: break
    array = np.array(list(map(float, input().split())))
    print(np.std(array))

Fixed submission:
import math
while True:
    num = int(input())
    if num == 0: break
    array = [int(i) for i in input().split()]
    mean = sum(array) / num
    a = 0
    for i in range(num):
        a += (array[i] - mean) ** 2
    a /= num
    a = math.sqrt(a)
    print(a)

Buggy python submission (verdict: Runtime Error):
import numpy as np
while True:
    num = int(input())
    if num == 0: break
    array = np.array(list(map(float, input().split())))
    print(str(np.std(array)))

Fixed submission:
import math
while True:
    num = int(input())
    if num == 0: break
    array = [int(i) for i in input().split()]
    mean = sum(array) / num
    a = 0
    for i in range(num):
        a += (array[i] - mean) ** 2
    a /= num
    a = math.sqrt(a)
    print(a)