P10352 [PA 2024] Who won?
Background
PA 2024 1C
Description
**This problem is translated from [PA 2024](https://sio2.mimuw.edu.pl/c/pa-2024-1/dashboard/) Round 1 [Kto wygrał?](https://sio2.mimuw.edu.pl/c/pa-2024-1/p/kto/).**
Algosia and Bajtek like to compete in PA. In the online contest, there are $18$ tasks to solve, and each task can give from $0$ to $10$ points. Contestants are ranked by total score. If the total scores are equal, the contestant who got $10$ points on more tasks is ranked higher. If there is still a tie, the contestant who got $9$ points on more tasks is ranked higher, and so on. If the contestants cannot be distinguished in this way, they are declared tied.
Algosia and Bajtek remember all their scores from last year’s contest, but they do not remember… who won. Can you help them write a program that reads their results and tells whose rank is higher?
Input Format
The first line contains $18$ integers in the range $[0, 10]$, representing Algosia’s score on each task.
The second line also contains $18$ integers in the range $[0, 10]$, representing Bajtek’s score on each task.
Output Format
Print one word on one line: `Algosia` or `Bajtek`, the name of the winner. If there is a tie, print `remis` (Polish for a draw).
Explanation/Hint
Although both Algosia and Bajtek have a total score of $161$ points, according to PA rules Algosia is ranked higher.
Translated by ChatGPT 5