a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] a.sort(reverse=True) b.sort(reverse=True) if sum(a) > sum(b): print('Algosia') elif sum(a) < sum(b): print('Bajtek') else: i = 0 result = 'remis' while i < len(a): if a[i] > b[i]: result = 'Algosia' break elif a[i] < b[i]: result = 'Bajtek' break else: i += 1 print(result)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] a.sort(reverse=True) b.sort(reverse=True) if sum(a) > sum(b): print('Algosia') elif sum(a) < sum(b): print('Bajtek') else: i = 0 result = 'remis' while i < len(a): if a[i] > b[i]: result = 'Algosia' break elif a[i] < b[i]: result = 'Bajtek' break else: i += 1 print(result) |