Buggy python submission (verdict: Runtime Error):
while True:
    n = int(raw_input())
    a = []
    for i in range(n):
        a.append(int(raw_input())
    b = list(set(a))
    flag = 0
    for i in b:
        if a.count(i) > n/2.0:
            ans = i
            flag = 1
    print ans if flag = 1 else "NO COLOR"

Fixed submission:
while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"

Buggy python submission (verdict: Runtime Error):
while True:
    n = int(raw_input())
    if n == 0:
        break
    a = map(int, raw_input().split())
    b = list(set(a))
    flag = 0
    for i in b:
        if a.count(i) > n/2.0:
            ans = i
            flag = 1
            break
    print ans if flag = 1 else "NO COLOR"

Fixed submission:
while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(raw_input())
    if n == 0:
        break
    a = map(int, raw_input().split())
    b = list(set(a))
    flag = 0
    for i in b:
        if a.count(i) > n/2.0:
            ans = i
            flag = 1
            break
    print ans if flag == 1 else "NO COLOR"

Fixed submission:
while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(raw_input())
    if n == 0:
        break
    a = map(int, raw_input().split())
    b = list(set(a))
    flag = 0
    if len(b) < n/2.0:
        for i in b:
            if a.count(i) > n/2.0:
                ans = i
                flag = 1
                break
    print ans if flag == 1 else "NO COLOR"

Fixed submission:
while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
	n = input()
	if n == 0: break
	A = map(int,raw_input().split())
	S = set(A)
	for i in S:
		if A.count(i) > n/2:
			print i
			break
	else:
		print "NO COLOR"

Fixed submission:
while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
	n = input()
	if n == 0: break
	A = sorted(map(int,raw_input().split()))
	for i in set(A):
		if (n-A[::-1].index(i)-1) - A.index(i) + 1 > n/2:
			print i
			break
	else:
		print "NO COLOR"

Fixed submission:
while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"