Algosia=list(map(int,input().split())) Bajtek=list(map(int,input().split())) Algosia=list(reversed(sorted(Algosia))) Bajtek=list(reversed(sorted(Bajtek))) Sa=0 for i in Algosia: Sa+=i Sb=0 for i in Bajtek: Sb+=i if Sa>Sb: print("Algosia") elif Sb>Sa: print("Bajtek") else: for i in range(18): if Algosia[i]>Bajtek[i]: print("Algosia") break elif Bajtek[i]>Algosia[i]: print("Bajtek") break elif i==17: print("remis")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | Algosia=list(map(int,input().split())) Bajtek=list(map(int,input().split())) Algosia=list(reversed(sorted(Algosia))) Bajtek=list(reversed(sorted(Bajtek))) Sa=0 for i in Algosia: Sa+=i Sb=0 for i in Bajtek: Sb+=i if Sa>Sb: print("Algosia") elif Sb>Sa: print("Bajtek") else: for i in range(18): if Algosia[i]>Bajtek[i]: print("Algosia") break elif Bajtek[i]>Algosia[i]: print("Bajtek") break elif i==17: print("remis") |