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
27
#include <bits/stdc++.h>
using namespace std;

int main()
{
  int sa[12] {0},sb[12] {0};
  for (int i=0; i<18; i++)
  {
    int a;
    cin >> a;
    sa[a]++;
    sa[11]+=a;
  }
  for (int i=0; i<18; i++)
  {
    int b;
    cin >> b;
    sb[b]++;
    sb[11]+=b;
  }
  for (int i=11; i>=0; i--)
    {
      if (sa[i]>sb[i]) {cout << "Algosia"; exit(0);}
      if (sa[i]<sb[i]) {cout << "Bajtek"; exit(0);}
    }
  cout << "remis" << endl;
}