Buggy python submission (verdict: Runtime Error):
def pbox(n,a):
    count = 0
    result = []
    for i in xrange(n):
        total = 0
        b = [a[j] for j in xrange(i,n,i+1)]
        total = sum(b)
        if total % 2 == 1 and a[i] == 1:
            result.append(i+1)
        else:
            pass

    print len(result)
    print ' '.join(map(str,result))

if __name__ == '__main__':
    n = int(raw_input())
    a = map(int,raw_input().split())

    pbox(n,a)
~

Fixed submission:
import copy
def calcmax(a,b,fst,scd,n):
    for i in xrange(n):
        if fst == a[i]:
            count = i

    for i in xrange(n):
        if count == i:
            print scd
        else:
            print fst

if __name__ == '__main__':
    n = int(raw_input())
    a = [int(raw_input()) for i in xrange(n)]
    print("")

    fst = max(a)

    b = copy.deepcopy(a)
    b.remove(fst)

    scd = max(b)

    calcmax(a,b,fst,scd,n)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
a = [raw_input() for i in xrange(n)]
b = map(int,a)
for i in xrange(n):
    ml = [b[j] for j in xrange(n) if j != i]
    print max(ml)

Fixed submission:
import copy
def calcmax(a,b,fst,scd,n):
    for i in xrange(n):
        if fst == a[i]:
            count = i

    for i in xrange(n):
        if count == i:
            print scd
        else:
            print fst

if __name__ == '__main__':
    n = int(raw_input())
    a = [int(raw_input()) for i in xrange(n)]
    print("")

    fst = max(a)

    b = copy.deepcopy(a)
    b.remove(fst)

    scd = max(b)

    calcmax(a,b,fst,scd,n)

Buggy python submission (verdict: Time Limit Exceeded):
def ehand(n,a):
    for i in range(n):
        print max(a[:i]+a[(i+1):])
 
if __name__ == '__main__':
    n = int(raw_input())
    a = []
    a = [raw_input() for i in range(n)]
 
    ehand(n,map(int,a))

Fixed submission:
import copy
def calcmax(a,b,fst,scd,n):
    for i in xrange(n):
        if fst == a[i]:
            count = i

    for i in xrange(n):
        if count == i:
            print scd
        else:
            print fst

if __name__ == '__main__':
    n = int(raw_input())
    a = [int(raw_input()) for i in xrange(n)]
    print("")

    fst = max(a)

    b = copy.deepcopy(a)
    b.remove(fst)

    scd = max(b)

    calcmax(a,b,fst,scd,n)

Buggy python submission (verdict: Time Limit Exceeded):
def ehand(n,a):
    for i in range(n):
        print max(a[:i]+a[(i+1):])
 
if __name__ == '__main__':
    n = int(raw_input())
    a = []
    a = [raw_input() for i in range(n)]

    ehand(n,map(int,a))

Fixed submission:
import copy
def calcmax(a,b,fst,scd,n):
    for i in xrange(n):
        if fst == a[i]:
            count = i

    for i in xrange(n):
        if count == i:
            print scd
        else:
            print fst

if __name__ == '__main__':
    n = int(raw_input())
    a = [int(raw_input()) for i in xrange(n)]
    print("")

    fst = max(a)

    b = copy.deepcopy(a)
    b.remove(fst)

    scd = max(b)

    calcmax(a,b,fst,scd,n)

Buggy python submission (verdict: Time Limit Exceeded):
def ehand(n,a):
    for i in range(n):
        print max(a[:i]+a[(i+1):])

if __name__ == '__main__':
    n = int(raw_input())
    a = []

    for i in range(n):
        a.append(int(raw_input()))

    ehand(n,a)

Fixed submission:
import copy
def calcmax(a,b,fst,scd,n):
    for i in xrange(n):
        if fst == a[i]:
            count = i

    for i in xrange(n):
        if count == i:
            print scd
        else:
            print fst

if __name__ == '__main__':
    n = int(raw_input())
    a = [int(raw_input()) for i in xrange(n)]
    print("")

    fst = max(a)

    b = copy.deepcopy(a)
    b.remove(fst)

    scd = max(b)

    calcmax(a,b,fst,scd,n)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
def ehand(n,a):
    for i in range(n):
        b = copy.deepcopy(a)
        del b[i]
        print max(b)

if __name__ == '__main__':
    n = int(raw_input())
    a = []

    for i in range(n):
        a.append(int(raw_input()))

    ehand(n,a)

Fixed submission:
import copy
def calcmax(a,b,fst,scd,n):
    for i in xrange(n):
        if fst == a[i]:
            count = i

    for i in xrange(n):
        if count == i:
            print scd
        else:
            print fst

if __name__ == '__main__':
    n = int(raw_input())
    a = [int(raw_input()) for i in xrange(n)]
    print("")

    fst = max(a)

    b = copy.deepcopy(a)
    b.remove(fst)

    scd = max(b)

    calcmax(a,b,fst,scd,n)