Buggy python submission (verdict: Runtime Error):
def main():
    INF = int(1e12)
    G = [[0 for i in range(101)] for j in range(101)];
 
    v, e = map(int, raw_input().split())
 
    for i in range(v):
        for j in range(v):
            if i == j:
                G[i][j] = 0
            else:
                G[i][j] = INF
 
    for i in range(e):
        s, t, d = map(int, raw_input().split())
        G[s][t] = d
 
    for k in range(v):
        for i in range(v):
            c2 = G[i][k]
            for j, (c1, c3) in enumerate(zip(G[i], G[k])):
                if ci > c2 + c3:
                    G[i][j] = c2 + c3
                    G[i][j] = min(G[i][j], G[i][k] + G[k][j])
 
    for i in range(v):
        if G[i][i] < 0:
            print "NEGATIVE CYCLE"
            return 0
 
    for i in range(v):
        ans = []
 
        for j in range(v):
            if G[i][j] == INF:
                ans.append("INF")
            else:
                ans.append(G[i][j])
 
        print " ".join(map(str, ans))
 
main()

Fixed submission:
def main():
    INF = int(1e12)
    G = [[0 for i in range(101)] for j in range(101)];

    v, e = map(int, raw_input().split())

    for i in range(v):
        for j in range(v):
            if i == j:
                G[i][j] = 0
            else:
                G[i][j] = INF

    for i in range(e):
        s, t, d = map(int, raw_input().split())
        G[s][t] = d

    for k in range(v):
        for i in range(v):
            for j in range(v):
                if G[i][k] != INF and G[k][j] != INF:
                    G[i][j] = min(G[i][j], G[i][k] + G[k][j])

    for i in range(v):
        if G[i][i] < 0:
            print "NEGATIVE CYCLE"
            return 0

    for i in range(v):
        ans = []

        for j in range(v):
            if G[i][j] == INF:
                ans.append("INF")
            else:
                ans.append(G[i][j])

        print " ".join(map(str, ans))

main()

Buggy python submission (verdict: Runtime Error):
def main():
    INF = int(1e12)
    G = [[0 for i in range(101)] for j in range(101)];
  
    v, e = map(int, raw_input().split())
  
    for i in range(v):
        for j in range(v):
            if i == j:
                G[i][j] = 0
            else:
                G[i][j] = INF
  
    for i in range(e):
        s, t, d = map(int, raw_input().split())
        G[s][t] = d
  
    for k in range(v):
        for i in range(v):
            c2 = G[i][k]
            for j, (c1, c3) in enumerate(zip(G[i], G[k])):
                if ci > c2 + c3:
                    G[i][j] = c2 + c3

    for i in range(v):
        if G[i][i] < 0:
            print "NEGATIVE CYCLE"
            return 0
  
    for i in range(v):
        ans = []
  
        for j in range(v):
            if G[i][j] == INF:
                ans.append("INF")
            else:
                ans.append(G[i][j])
  
        print " ".join(map(str, ans))
  
main()

Fixed submission:
def main():
    INF = int(1e12)
    G = [[0 for i in range(101)] for j in range(101)];

    v, e = map(int, raw_input().split())

    for i in range(v):
        for j in range(v):
            if i == j:
                G[i][j] = 0
            else:
                G[i][j] = INF

    for i in range(e):
        s, t, d = map(int, raw_input().split())
        G[s][t] = d

    for k in range(v):
        for i in range(v):
            for j in range(v):
                if G[i][k] != INF and G[k][j] != INF:
                    G[i][j] = min(G[i][j], G[i][k] + G[k][j])

    for i in range(v):
        if G[i][i] < 0:
            print "NEGATIVE CYCLE"
            return 0

    for i in range(v):
        ans = []

        for j in range(v):
            if G[i][j] == INF:
                ans.append("INF")
            else:
                ans.append(G[i][j])

        print " ".join(map(str, ans))

main()