Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
word = raw_input()
counter = 0
while True:
    line = raw_input()
    if line == "end_of_text":
        break
    counter += line.lower().split(" ").count(word)

print counter

Fixed submission:
word = raw_input()
counter = 0
while True:
    line = raw_input()
    if line == "END_OF_TEXT":
        break
    counter += line.lower().split(" ").count(word)

print counter
Buggy python submission (verdict: Time Limit Exceeded):
# 2018/06/02

class Deque2(object):
    def __init__(self):
        self.a = list()

    def push(self, d, x):
        if d == 0:
            self.a = [x] + self.a
        elif d == 1:
            self.a.append(x)

    def randomAccess(self, p):
        print self.a[p]

    def pop(self, d):
        if d == 0:
            self.a = self.a[1:]
        elif d == 1:
            self.a = self.a[:-1]

    def __repr__(self):
        return " ".join([str(i) for i in self.a])

if __name__ == "__main__":
    d = Deque2()
    q = int(raw_input())
    for i in range(q):
        query = [int(j) for j in raw_input().split()]
        if query[0] == 0:
            d.push(query[1], query[2])
        elif query[0] == 1:
            d.randomAccess(query[1])
        elif query[0] == 2:
            d.pop(query[1])


Fixed submission:
# 2018/06/02

from collections import deque

d = deque()
q = int(raw_input())

for i in range(q):
    query = [int(j) for j in raw_input().split()]
    if query[0] == 0:
        if query[1] == 0:
            d.appendleft(query[2])
        else:
            d.append(query[2])
    elif query[0] == 1:
        print  d[query[1]]
    elif query[0] == 2:
        if query[1] == 0:
            d.popleft()
        else:
            d.pop()

Buggy python submission (verdict: Time Limit Exceeded):
# 2018/06/02
 
class Deque2(object):
    def __init__(self):
        self.a = list()
 
    def push(self, d, x):
        if d == 0:
            self.a = [x] + self.a
        elif d == 1:
            self.a.append(x)
 
    def randomAccess(self, p):
        print self.a[p]
 
    def pop(self, d):
        if d == 0:
            self.a = self.a[1:]
        elif d == 1:
            self.a = self.a[:-1]
 
    def __repr__(self):
        return " ".join([str(i) for i in self.a])
 
if __name__ == "__main__":
    d = Deque2()
    q = int(raw_input())
    for i in range(q):
        query = [int(j) for j in raw_input().split()]
        if query[0] == 0:
            d.push(query[1], query[2])
        elif query[0] == 1:
            d.randomAccess(query[1])
        elif query[0] == 2:
            d.pop(query[1])


Fixed submission:
# 2018/06/02

from collections import deque

d = deque()
q = int(raw_input())

for i in range(q):
    query = [int(j) for j in raw_input().split()]
    if query[0] == 0:
        if query[1] == 0:
            d.appendleft(query[2])
        else:
            d.append(query[2])
    elif query[0] == 1:
        print  d[query[1]]
    elif query[0] == 2:
        if query[1] == 0:
            d.popleft()
        else:
            d.pop()
Buggy python submission (verdict: Runtime Error):
l = []
for i in range(10):
    inp = input()
    l.append(int(inp))
l.sort().reverse()
for i in range(3):
    print(l[i])

Fixed submission:
l = []
for i in range(10):
    inp = input()
    l.append(int(inp))
l.sort()
l.reverse()
for i in range(3):
    print(l[i])

Buggy python submission (verdict: Runtime Error):
l = []
for i in range(10):
    inp = input()
    l.append(int(inp.rstrip()))
l.sort().reverse()
for i in range(3):
    print(l[i])

Fixed submission:
l = []
for i in range(10):
    inp = input()
    l.append(int(inp))
l.sort()
l.reverse()
for i in range(3):
    print(l[i])
Buggy python submission (verdict: Runtime Error):
t = int(input())
point_l = [0 for i in range(t)]
for i in range((t*(t-1))/2):
    input_line = input()
    tmp = [int(x) for x in input_line.rstrip().split(' ')]
    if tmp[2] > tmp[3]:
        point_l[tmp[0]-1] += 3
    elif tmp[3] > tmp[2]:
        point_l[tmp[1]-1] += 3
    elif tmp[2] == tmp[3]:
        point_l[tmp[0]-1] += 1
        point_l[tmp[1]-1] += 1

rank_l = [0 for i in range(t)]
rank = 1
for l in sorted(point_l, reverse=True):
    dup = point_l.count(l)
    for j in range(dup):
        rank_l[point_l.index(l)] += rank
        point_l[point_l.index(l)] = -1
    rank += dup

for l in rank_l:
    print(l)

Fixed submission:
t = int(input())
point_l = [0 for i in range(t)]
for i in range(int(t*(t-1)/2)):
    tmp = [int(x) for x in input().split()]
    if tmp[2] > tmp[3]:
        point_l[tmp[0]-1] += 3
    elif tmp[3] > tmp[2]:
        point_l[tmp[1]-1] += 3
    elif tmp[2] == tmp[3]:
        point_l[tmp[0]-1] += 1
        point_l[tmp[1]-1] += 1

rank_l = [0 for i in range(t)]
rank = 1
for l in sorted(point_l, reverse=True):
    dup = point_l.count(l)
    for j in range(dup):
        rank_l[point_l.index(l)] += rank
        point_l[point_l.index(l)] = -1
    rank += dup

for l in rank_l:
    print(l)
Buggy python submission (verdict: Runtime Error):
import sys
import math
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        output1 = math.gcd(a, b)
        output2 = int(a * b / output1)
        print(output1, output2)


if __name__ == "__main__":
    main()

Fixed submission:
import sys
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        if a > b:
            a,b = b,a
        p = a * b #product

        while True:
            hoge = a
            a = b % a
            b = hoge
            if a == 0:
                gcd = b
                break

        lcm = p // gcd
        print(gcd, lcm)




if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import sys
import math
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        o1 = math.gcd(a, b)
        o2 = int(a * b / o1)
        print(o1, o2)


if __name__ == "__main__":
    main()

Fixed submission:
import sys
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        if a > b:
            a,b = b,a
        p = a * b #product

        while True:
            hoge = a
            a = b % a
            b = hoge
            if a == 0:
                gcd = b
                break

        lcm = p // gcd
        print(gcd, lcm)




if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
def main():
    ans = [0] * 2
    for line in sys.stdin:
        try:
            a,b,c = map(int, line.split())
            if a ** 2 + b ** 2 == c ** 2:
                ans[0] += 1
            else:
                ans[1] += 1

        except EOFError:
            for a in ans:
                print(a)


if __name__ == "__main__":
    main()

Fixed submission:
import sys
def main():
    r = 0
    d = 0
    for line in sys.stdin:
        A = list(map(int, line.split(",")))
        if A[0] == A[1]:
            d += 1
        else:
            if A[0] ** 2 + A[1] ** 2 == A[2] ** 2:
                r += 1

    print(r)
    print(d)



if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import sys
def main():
    ans = [0] * 2
    for line in sys.stdin:
        try:
            a,b,c = map(int, line.split())
            if a ** 2 + b ** 2 == c ** 2:
                ans[0] += 1
            else:
                ans[1] += 1

            for a in ans:
                print(a)

        except EOFError:
            for a in ans:
                print(a)


if __name__ == "__main__":
    main()

Fixed submission:
import sys
def main():
    r = 0
    d = 0
    for line in sys.stdin:
        A = list(map(int, line.split(",")))
        if A[0] == A[1]:
            d += 1
        else:
            if A[0] ** 2 + A[1] ** 2 == A[2] ** 2:
                r += 1

    print(r)
    print(d)



if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import sys
def main():
    ans = [0] * 2
    for line in sys.stdin:
        a,b,c = map(int, line.split())
        if a ** 2 + b ** 2 == c ** 2:
            ans[0] += 1
        else:
            ans[1] += 1

    for a in ans:
            print(a)


if __name__ == "__main__":
    main()

Fixed submission:
import sys
def main():
    r = 0
    d = 0
    for line in sys.stdin:
        A = list(map(int, line.split(",")))
        if A[0] == A[1]:
            d += 1
        else:
            if A[0] ** 2 + A[1] ** 2 == A[2] ** 2:
                r += 1

    print(r)
    print(d)



if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
def main():
    for line in sys.stdin:
        n = int(line)
        for x in range(1, n + 1):
            s = int(input())
            a = [] #answer
            for _ in range(10):
                s = "{0:08d}".format(s ** 2)
                s = list(s)
                hoge = ""
                for y in range(2, 6):
                    hoge += s[y]
                s = int(hoge)
                a.append(s)
            else:
                print("Case", x,end = "")
                print(":")
                for y in a:
                    print(y)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    d = int(input())
    a = []
    for _ in range(d):
        a.append(int(input()))

    for x in range(len(a)):
        print("Case ",end = "")
        print(x+1, end = "")
        print(":")
        for _ in range(10):
            a[x] = str("{0:08d}".format(a[x] ** 2))
            hoge = ""
            for y in range(2, 6):
                hoge += a[x][y]
            hoge = int(hoge)
            a[x] = hoge
            print(a[x])


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):

def main():
    n = int(iuput())
    for x in range(1, n + 1):
        s = int(input())
        a = [] #answer
        for _ in range(10):
            s = "{0:08d}".format(s ** 2)
            s = list(s)
            hoge = ""
            for y in range(2, 6):
                hoge += s[y]
            s = int(hoge)
            a.append(s)
        else:
            print("Case", x,end = "")
            print(":")
            for y in a:
                print(y)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    d = int(input())
    a = []
    for _ in range(d):
        a.append(int(input()))

    for x in range(len(a)):
        print("Case ",end = "")
        print(x+1, end = "")
        print(":")
        for _ in range(10):
            a[x] = str("{0:08d}".format(a[x] ** 2))
            hoge = ""
            for y in range(2, 6):
                hoge += a[x][y]
            hoge = int(hoge)
            a[x] = hoge
            print(a[x])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    p = list(map(int, input().split()))
    p.sort()
    pp = list(set(p))

    cnt = 0
    for i in range(len(pp)):
        cnt += 1
        scnt = 0
        for j in range(len(p)):
            if pp[i] <= pp[j]:
                scnt += 1
        if cnt == scnt:
            break
    print(cnt)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N = int(input())
    p = list(map(int, input().split()))
    ans = []

    sc = 1 #score count
    for _ in range(N):
        cnt = 0
        for i in range(len(p)):
            if p[i] >= sc:
                cnt += 1
        if cnt >= sc:
            ans.append(sc)
        sc += 1

    ans.sort(reverse = True)
    print(ans[0])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    d = list(input())
    alp = [chr(i) for i in range(65, 65 + 26)]

    for x in range(len(d)):
        idx = alp.index(d[x]) - 3
        if idx < 0:
            idx = 26 - idx
        else:
            pass
        d[x] = alp[idx]

    ans = ""
    for x in d:
        ans += x
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    d = list(input())
    alp = [chr(i) for i in range(65, 65 + 26)]

    for x in range(len(d)):
        idx = alp.index(d[x]) - 3
        if idx < 0:
            idx = 26 + idx
        else:
            pass
        d[x] = alp[idx]

    ans = ""
    for x in d:
        ans += x
    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    d = list(input())
    alp = [chr(i) for i in range(65, 65 + 26)]

    for x in range(len(d)):
        idx = alp.index(d[x]) - 3
        if idx < 0:
            idx = 26 - idx
        else:
            pass
        d[x] = alp[idx]

    ans = ""
    for x in d:
        ans += x
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    d = list(input())
    alp = [chr(i) for i in range(65, 65 + 26)]

    for x in range(len(d)):
        idx = alp.index(d[x]) - 3
        if idx < 0:
            idx = 26 + idx
        else:
            pass
        d[x] = alp[idx]

    ans = ""
    for x in d:
        ans += x
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math
def main():
    x1, y1, x2, y2 = map(int, input().split())
    b = abs(x2 - x1)
    h = abs(y2 - y1)
    d = math.sqrt(b ** 2 + h ** 2)
    print(d)
    

if __name__ == "__main__":
    main()

Fixed submission:
import math
def main():
    x1, y1, x2, y2 = map(float, input().split())
    b = abs(x2 - x1)
    h = abs(y2 - y1)
    d = math.sqrt(b ** 2 + h ** 2)
    print("{0:.8f}".format(d))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import math
def main():
    x1, y1, x2, y2 = map(int, input().split())
    b = abs(x2 - x1)
    h = abs(y2 - y1)
    d = math.sqrt(b ** 2 + h ** 2)
    print("{0:.8f}".format(d))


if __name__ == "__main__":
    main()

Fixed submission:
import math
def main():
    x1, y1, x2, y2 = map(float, input().split())
    b = abs(x2 - x1)
    h = abs(y2 - y1)
    d = math.sqrt(b ** 2 + h ** 2)
    print("{0:.8f}".format(d))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math
def main():
    r = int(input())
    s = math.pi * r ** 2
    l = r * 2 * math.pi
    print(s, l)


if __name__ == "__main__":
    main()

Fixed submission:
import math
def main():
    r = float(input())
    s = math.pi * r ** 2
    l = r * 2 * math.pi
    print(format(s, ".6f"), format(l, ".6f"))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import math
def main():
    r = int(input())
    s = math.pi * r ** 2
    l = r * 2 * math.pi
    print(format(s, ".6f"), format(l, ".6f"))


if __name__ == "__main__":
    main()

Fixed submission:
import math
def main():
    r = float(input())
    s = math.pi * r ** 2
    l = r * 2 * math.pi
    print(format(s, ".6f"), format(l, ".6f"))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
N = input()
for i in range(N):
	l = []
	line = raw_input()
	l.append(int(line.split()[0]))
	l.append(int(line.split()[1]))
	l.append(int(line.split()[2]))
	l.sort()
	if l[0]*l[0]+l[1]*l[1]==l[2]*l[2]:
		print("YES")
	else:
		print("NO")

Fixed submission:
N = int(input())
for i in range(N):
	line = input()
	l = [None]*3
	l[0] = int(line.split()[0])
	l[1] = int(line.split()[1])
	l[2] = int(line.split()[2])
	l.sort()
	if l[0]**2+l[1]**2==l[2]**2:
		print("YES")
	else:
		print("NO")

Buggy python submission (verdict: Runtime Error):
N = input()
for i in range(N):
	l = []
	line = raw_input()
	l.append(int(line.split()[0]))
	l.append(int(line.split()[1]))
	l.append(int(line.split()[2]))
	l.sort()
	if l[0]*l[0]+l[1]*l[1]==l[2]*l[2]:
		print("YES")
	else:
		print("NO")

Fixed submission:
N = int(input())
for i in range(N):
	line = input()
	l = [None]*3
	l[0] = int(line.split()[0])
	l[1] = int(line.split()[1])
	l[2] = int(line.split()[2])
	l.sort()
	if l[0]**2+l[1]**2==l[2]**2:
		print("YES")
	else:
		print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(N):
	l = []
	line = raw_input()
	l.append(int(line.split()[0]))
	l.append(int(line.split()[1]))
	l.append(int(line.split()[2]))
	l.sort()
	if l[0]*l[0]+l[1]*l[1]==l[2]*l[2]:
		print("YES")
	else:
		print("NO")

Fixed submission:
N = int(input())
for i in range(N):
	line = input()
	l = [None]*3
	l[0] = int(line.split()[0])
	l[1] = int(line.split()[1])
	l[2] = int(line.split()[2])
	l.sort()
	if l[0]**2+l[1]**2==l[2]**2:
		print("YES")
	else:
		print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(N):
	l = []
	line = raw_input()
	l.append(int(line.split()[0]))
	l.append(int(line.split()[1]))
	l.append(int(line.split()[2]))
	l.sort()
	if l[0]**2+l[1]**2==l[2]**2:
		print("YES")
	else:
		print("NO")

Fixed submission:
N = int(input())
for i in range(N):
	line = input()
	l = [None]*3
	l[0] = int(line.split()[0])
	l[1] = int(line.split()[1])
	l[2] = int(line.split()[2])
	l.sort()
	if l[0]**2+l[1]**2==l[2]**2:
		print("YES")
	else:
		print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(N):
	line = raw_input()
	l = [None]*3
	l[0] = int(line.split()[0])
	l[1] = int(line.split()[1])
	l[2] = int(line.split()[2])
	l.sort()
	if l[0]**2+l[1]**2==l[2]**2:
		print("YES")
	else:
		print("NO")

Fixed submission:
N = int(input())
for i in range(N):
	line = input()
	l = [None]*3
	l[0] = int(line.split()[0])
	l[1] = int(line.split()[1])
	l[2] = int(line.split()[2])
	l.sort()
	if l[0]**2+l[1]**2==l[2]**2:
		print("YES")
	else:
		print("NO")
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

d = sys.stdin.readline()
while d:
    a,b,c,d,e,f = map(int,d.split())
    A = np.array([[a,b],[d,e]])
    B = np.array([c,f])
    x = np.linalg.inv(A).dot(B)
    print("%.3f %.3f"%(x[0],x[1]))

    d = sys.stdin.readline()

Fixed submission:
import sys

d = sys.stdin.readline()
while d:
    a,b,c,d,e,f = map(int,d.split())
    inv = 1/(a*e - b*d)
    iA = [[e,-b],[-d,a]]
    B = [c,f]
    sol = list()
    for i in range(2):
        tmp = 0
        for j in range(2):
            tmp += inv*iA[i][j] * B[j]
        sol.append(tmp)
    print("%.3f %.3f"%(sol[0],sol[1]))

    d = sys.stdin.readline()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

n = int(sys.stdin.readline())
while n:
    l = list()
    for _ in range(n):
        l.append(int(input()))

    maxs = 0
    for i in range(n):
        for j in range(i,n):
            s = 0
            for k in range(i,j+1):
                s += l[k]
            maxs = max(maxs,s)
    n = int(sys.stdin.readline())
    print(maxs)

Fixed submission:
import sys

n = int(sys.stdin.readline())
while n:
    l = list()
    for _ in range(n):
        l.append(int(input()))
    a = l.copy()
    for i in range(1,n):
        a[i] = max(a[i-1] + l[i], l[i])
    print(max(a))
    n = int(sys.stdin.readline())
Buggy python submission (verdict: Runtime Error):
import numpy as np

class Employee():
    def __init__(self,id,p,q):
        self.id = id
        self.total = p*q
    
    def add_total(self,total):
        self.total += total

class Manager():
    def __init__(self):
        self.employees = list()
        self.count = 0
    
    def add(self,e):
        if len(self.employees) == 0:
            self.employees.append(e)
        else:
            if self.employees[-1].id == e.id:
                self.employees[-1].add_total(e.total)
            else:
                self.employees.append(e)
            
    def pprint(self):
        for i,e in enumerate(self.employees):
            if e.total >= 1000000:
                print(e.id)
                self.count+=1
        if self.count == 0:
            print("NA")

def main():
    while(True):
        m = Manager()
        n = int(input())
        if n==0:
            break
        l = list()
        for i in range(n):
            s = list(map(int,input().split()))
            l.append(s)
        l = sorted(l)
        for x in l:
            m.add(Employee(*x))
        m.pprint()
    

if __name__=="__main__":
    main()

Fixed submission:
while(True):
    n = int(input())
    if n==0: break
    d = {}
    c = 0
    l = list()
    for _ in range(n):
        id_,p,q = map(int,input().split())
        if id_ in d:
            d[id_] += p*q
        else:
            d[id_] = p*q
            l.append(id_)
    for i in l:
        if d[i] >= 1000000:
            print(i)
            c += 1
    if c == 0:
        print('NA')

Buggy python submission (verdict: Runtime Error):
while(True):
    n = int(input())
    if n==0: break
    d = dict()
    s = set()
    c = 0
    for _ in range(n):
        id_,p,q = map(int,input().split())
        if id_ in s:
            d[id_] += p*q
        else:
            s.add(id_)
            d[id_] = p*q
    for i in s:
        if d[i] >= 1000000:
            print(i)
            c+=1
    if c == 0: print("NA")

Fixed submission:
while(True):
    n = int(input())
    if n==0: break
    d = {}
    c = 0
    l = list()
    for _ in range(n):
        id_,p,q = map(int,input().split())
        if id_ in d:
            d[id_] += p*q
        else:
            d[id_] = p*q
            l.append(id_)
    for i in l:
        if d[i] >= 1000000:
            print(i)
            c += 1
    if c == 0:
        print('NA')
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

import codecs
import sys

sys.stdout = codecs.getwriter("shift_jis")(sys.stdout) # ??????
sys.stdin = codecs.getreader("shift_jis")(sys.stdin) # ??\???

# ??\??¬?????????print??????????????´?????? print(u'?????????') ??¨??????
# ??\??¬?????????input??? input(u'?????????') ??§OK
# ??°?¢???????????????????????????´??????6,7???????????????????????¢??????

a = []
while True:
	n = input()
	if n == -1:
		break
	a.append(n)

#a = [0,5,2,3,4,1]

a.sort()
a.reverse()

print a[0]
print a[1]
print a[2]

Fixed submission:
# coding: utf-8

import codecs
import sys

sys.stdout = codecs.getwriter("shift_jis")(sys.stdout) # ??????
sys.stdin = codecs.getreader("shift_jis")(sys.stdin) # ??\???

# ??\??¬?????????print??????????????´?????? print(u'?????????') ??¨??????
# ??\??¬?????????input??? input(u'?????????') ??§OK
# ??°?¢???????????????????????????´??????6,7???????????????????????¢??????

a = []
for i in range(10):
	n = input()
	a.append(n)

#a = [0,5,2,3,4,1]

a.sort(reverse=True)

print a[0]
print a[1]
print a[2]
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

while True:
	data = map(int, raw_input().split())
	a = data[0]
	b = data[1]
	c = data[2]
	d = data[3]
	e = data[4]
	f = data[5]

	x = (c*e-b*f)*1.0 / (a*e-b*d)
	if x == -0.000:
		x = 0.000
	if b != 0:
		y = (c-a*x)/b
	else:
		y = (f-d*x)/e
	if y == -0.000:
		y = 0.000

	print("{:.3f} {:.3f}".format(x,y))

Fixed submission:
# coding: utf-8

while True:
	try:
		data = map(int, raw_input().split())
		a = data[0]
		b = data[1]
		c = data[2]
		d = data[3]
		e = data[4]
		f = data[5]

		x = (c*e-b*f)*1.0 / (a*e-b*d)
		if x == -0.000:
			x = 0.000
		if b != 0:
			y = (c-a*x)/b
		else:
			y = (f-d*x)/e
		if y == -0.000:
			y = 0.000

		print("{:.3f} {:.3f}".format(x,y))
	except EOFError:
		break

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

while True:
	data = map(int, raw_input().split())
	a = data[0]
	b = data[1]
	c = data[2]
	d = data[3]
	e = data[4]
	f = data[5]

	x = (c*e-b*f)*1.0 / (a*e-b*d)
	if x == -0.000:
		x = 0.000
	if b != 0:
		y = (c-a*x)/b
	else:
		y = (f-d*x)/e
	if y == -0.000:
		y = 0.000

	print("{:.3f} {:.3f}".format(x,y))

Fixed submission:
# coding: utf-8

while True:
	try:
		data = map(int, raw_input().split())
		a = data[0]
		b = data[1]
		c = data[2]
		d = data[3]
		e = data[4]
		f = data[5]

		x = (c*e-b*f)*1.0 / (a*e-b*d)
		if x == -0.000:
			x = 0.000
		if b != 0:
			y = (c-a*x)/b
		else:
			y = (f-d*x)/e
		if y == -0.000:
			y = 0.000

		print("{:.3f} {:.3f}".format(x,y))
	except EOFError:
		break