stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int n;

int a[205];

bool dp[105][10005];



int main()

{

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

        scanf("%d",&a[i]);

    dp[0][0]=1;

    for(int i=1;i<=n;i++)

    {

        dp[i][0]=1;

        for(int j=1;j<=10005;j++)

        {

            dp[i][j]|=dp[i-1][j];

            if(j-a[i]>=0)

                dp[i][j]|=dp[i-1][j-a[i]];

        }

    }



    for(int j=10000;j>=0;j--)

    {

        if(j==0)

        {

            printf("0\n");

            return 0;

        }

        if(j%10==0)continue;

        if(dp[n][j])

        {

            printf("%d\n",j);

            return 0;

        }

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.1043132607806354x):
#include <iostream>

#include <algorithm>

using namespace std;



const int N = 110;



int q[N];



int main()

{

    int n;

    cin >> n;



    for (int i = 0; i < n ; i ++ )

        cin >> q[i];



    int sum = 0;



    sort(q,q+n);



    for (int i = 0; i < n; i ++ )

        sum += q[i];



        if(sum % 10 == 0)

        {

            for (int j = 0; j < n; j ++ )

            {

                if(q[j] % 10 != 0)

                    {

                        sum -= q[j];

                        cout << sum << endl;

                        return 0;

                    }

            }

        }

        else  cout << sum << endl;

        if(sum % 10 == 0) cout << "0" << endl;

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cstring>

#include <vector>

#include <map>

#include <set>

#include <list>

#include <algorithm>



#define REP(i, n) for(int i=0;i<n;i++)

#define ll long long

#define INF 999999999

#define pb(a) push_back(a)



using namespace std;



bool dp[100001];

int n;

vector<int> v;



int main(){



  scanf("%d", &n);

  REP(i, n){

    int t;

    scanf("%d", &t);

    v.pb(t);

  }



  REP(i, 100001) dp[i] = false;



  dp[0] = true;

  REP(i, n){

    for(int j = 100000; j >= 0; --j){

      if(dp[j]){

        dp[j + v[i]] = true;

      }

    }

  }



  int res = 0;

  REP(i, 100001){

    if(dp[i] && i % 10 != 0 && res < i){

      res = i;

    }

  }



  printf("%d\n", res);



  return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.4848699540273318x):
#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cstring>

#include <climits>

#include <vector>

#include <map>

#include <set>

#include <list>

#include <stack>

#include <queue>

#include <algorithm>

#include <iostream>

#include <string>



#define REP(i,n) for(auto i=0;i<n;++i)

#define REPR(i,n) for(auto i=n;i>=0;--i)

#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)

#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)

#define FOR(i,a,b) for(auto i=a;i<b;++i)

#define SORT(v,n) sort(v, v+n)

#define SORTV(v) sort(v.begin(), v.end())

#define ALL(v) v.begin(),v.end()

#define llong long long

#define ll long long

#define INF 999999999

#define MOD 1000000007

#define pb push_back

#define pf push_front

#define MP make_pair

#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}



int dx[] = {0, 0, -1, 1};

int dy[] = {1, -1, 0, 0};



using namespace std;



typedef pair<int,int> pii;



bool dp[110][10010];



int main(){



  int n;

  cin >> n;

  vector<int> s(n);

  REP(i,n){

    cin >> s[i];

  }



  dp[0][0] = true;

  for(int i = 0; i < n; ++i){

    for(int j = 0; j <= n * 100; ++j){

      if(j - s[i] >= 0){

        dp[i+1][j] = max(dp[i][j-s[i]], dp[i][j]);

      }else{

        dp[i+1][j] = dp[i][j];

      }

    }

  }



  int ans = 0;

  REP(i,n*100+1){

    if(dp[n][i] && i % 10 != 0)

    ans = max(ans, i);

  }



  cout << ans << endl;



  return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

typedef long long ll;



const int maxn = 123;

int n , a[maxn] , dp[maxn][10009];





int calc(int x , int have)

{

	if(x == n)

	{

		if(have % 10 == 0) return 0;

		else return have;

	}

	if(dp[x][have] != -1) return dp[x][have];

	int ret = 0;

	ret = max(calc(x + 1 , have) , calc(x + 1 , have + a[x]));

	return dp[x][have] = ret;

}



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(NULL);

	memset(dp,-1,sizeof(dp));

	cin >> n;

	for(int i=0;i<n;i++) cin >> a[i];		

	cout << calc(0 , 0) << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.609126279730023x):
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

typedef long long ll;



const int maxn = 123;

int n , a[maxn];

bool dp[maxn][10009];



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(NULL);

	cin >> n;

	for(int i=0;i<n;i++) cin >> a[i];

	for(int i=0;i<=n;i++) dp[i][0] = 1;

	for(int i=1;i<=n;i++)

	{

		for(int have=1;have<=10000;have++)

		{

			if(have - a[i-1] >= 0) dp[i][have] = dp[i-1][have] | dp[i-1][have - a[i-1]];

			else dp[i][have] = dp[i-1][have];

		}

	}

	

	for(int i=10000;i>0;i--)

	{

		if(dp[n][i] && i % 10 != 0)

		{

			cout << i << endl;

			return 0;

		}

	}

	cout << 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>



using namespace std;



int dp[101][10001];

int main() {

    int N;

    cin >> N;

    vector<int> S;

    for(int i = 0; i < N; i++) {

        int s;

        cin >> s;

        S.push_back(s);

    }

    

    dp[0][0] = 1;

    

    for(int i = 0; i < N; i++) {

        for(int j = 0; j < 10001; j++) {

            if (dp[i][j] != 0) {

                dp[i + 1][j + S[i]] |= dp[i][j];

            }

            dp[i + 1][j] |= dp[i][j];

        }

    }

    

    for(int j = 10000; j >= 0; j--) {

        if (dp[N][j] != 0 && (j % 10 != 0)) {

            cout << j << endl;

            break;

        }

        if (j == 0) {

            cout << 0 << endl;

        }

    }

    

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1617900543260853x):
#include <map>

#include <set>

#include <list>

#include <cmath>

#include <queue>

#include <stack>

#include <cstdio>

#include <string>

#include <vector>

#include <complex>

#include <cstdlib>

#include <cstring>

#include <numeric>

#include <sstream>

#include <iostream>

#include <algorithm>

#include <functional>

  

#define mp       make_pair

#define pb       push_back

#define all(x)   (x).begin(),(x).end()

#define rep(i,n) for(int i=0;i<(n);i++)

  

using namespace std;

  

typedef    long long          ll;

typedef    unsigned long long ull;

typedef    vector<bool>       vb;

typedef    vector<int>        vi;

typedef    vector<vb>         vvb;

typedef    vector<vi>         vvi;

typedef    pair<int,int>      pii;

  

const int INF=1<<29;

const double EPS=1e-9;

  

const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};





int main() {

  int N;

  cin >> N;

  vector<ll> S(N);

  ll sum = 0;

  for (int i = 0; i < N; i++) {

    cin >> S[i];

    sum += S[i];

  }



  if (sum % 10 != 0) {

    cout << sum << endl;

  } else {

    ll mi = 1LL << 61;

    for(int i = 0; i < N; i++) {

      if (S[i] % 10 == 0) continue;

      mi = min(mi, S[i]);

    }

    if (mi == 1LL << 61) {

      cout << 0 << endl;

    } else {

      cout << sum - mi << endl;

    }

  }



  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int dp(int now,int sum);

int n;

int a[109];

int memo[109][10009];



int main(){

  memset(memo,-1,sizeof(memo));

  cin>>n;

  for(int i=0;i<n;i++){

    cin>>a[i];

  }

  cout<<dp(0,0)<<endl;

}



int dp(int now,int sum){

  int rec=0;

  if(memo[now][sum]!=-1)return memo[now][sum];

  if(now==n){

    if(sum%10==0)return 0;

    else return sum;

  }

  rec=max(rec,dp(now+1,sum));

  rec=max(rec,dp(now+1,sum+a[now]));

  return memo[now][sum]=rec;

}

  


// Faster C++ solution for the same problem (measured speedup: 4.791098216422056x):
#include<bits/stdc++.h>

using namespace std;

int dp[109][10009];



int main(){

  int n,s=10000;

  int a[109];

  cin>>n;

  for(int i=0;i<n;i++){

    cin>>a[i];

  }

  dp[0][0]=true;

  for(int i=0;i<n;i++){

    for(int j=0;j<=s;j++){

      if(j-a[i]<0){

	dp[i+1][j]=dp[i][j];

      }

      else{

	dp[i+1][j]=dp[i][j]|dp[i][j-a[i]];

      }

    }

  }

  int ans=0;

  for(int i=0;i<=s;i++){

    if(dp[n][i]&&i%10!=0){

      ans=i;

    }

  }

  cout<<ans<<endl;

  return(0);

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, a, n) for(int i = a; i < n; i++)

#define repb(i, a, b) for(int i = a; i >= b; i--)

#define all(a) a.begin(), a.end()

#define o(a) cout << a << endl

#define int long long

#define fi first

#define se second

using namespace std;

typedef pair<int, int> P;



int dp[10010];



signed main(){

    int n;

    cin >> n;

    int d[110] = {};

    rep(i, 0, n) cin >> d[i];

    rep(i, 0, 10010) dp[i] = -1; 

    dp[0] = 0;

    rep(i, 0, n){

        repb(j, 10000, 0){

            if(j - d[i] >= 0 && dp[j - d[i]] != -1){

                dp[j] = 1;

            }

        }

    }

    int ans = 0;

    rep(i, 0, 10010) if(dp[i] == 1 && i % 10 != 0) ans = i;

    cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.1106575253084197x):
#include <bits/stdc++.h>

#define rep(i, a, n) for(int i = a; i < n; i++)

#define REP(i, n) rep(i, 0, n)

#define repb(i, a, b) for(int i = a; i >= b; i--)

#define all(a) a.begin(), a.end()

#define int long long

#define chmax(x, y) x = max(x, y)

#define chmin(x, y) x = min(x, y)

using namespace std;

typedef pair<int, int> P;

const int mod = 1000000007;

const int INF = 1e12;



signed main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    int n;

    cin >> n;

    vector<int> s(n);

    int sum = 0;

    rep(i, 0, n){

        cin >> s[i];

        sum += s[i];

    }

    sort(all(s));

    bool f = false;

    if(sum % 10 == 0) f = true;

    rep(i, 0, n){

        if(f && s[i] % 10 != 0){

            sum -= s[i];

            f = false;

        }

    }

    if(f == false) cout << sum << endl;

    else cout << 0 << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

    int x, a, b;

    cin >> x >> a >> b;

    int diff_a = abs(x - a), diff_b = abs(x - b);

    if(diff_a < diff_b) cout << "A" << endl;

    else cout << "B" << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.3078097266708415x):
#include <stdio.h>



int main (){

	int input[100];

	for (int a=0;a<3;a++){

		scanf ("%d",&input[a]);

	}

	int jarak1=input[0]-input[1];

	int jarak2=input[0]-input[2];

	if (jarak1<0){

		jarak1*=-1;

	}

	if (jarak2<0){

		jarak2*=-1;

	}

	if(jarak2<jarak1){

		printf ("B\n");

	}

	else if (jarak1<jarak2){

		printf ("A\n");

	}



}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

    int x,a,b;

    scanf("%d %d %d",&x,&a,&b);

    if(abs(x-a)<abs(x-b))

        printf("A\n");

    else

        printf("B\n");







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.239721344577035x):
#include <stdio.h>



int main (){

	int input[100];

	for (int a=0;a<3;a++){

		scanf ("%d",&input[a]);

	}

	int jarak1=input[0]-input[1];

	int jarak2=input[0]-input[2];

	if (jarak1<0){

		jarak1*=-1;

	}

	if (jarak2<0){

		jarak2*=-1;

	}

	if(jarak2<jarak1){

		printf ("B\n");

	}

	else if (jarak1<jarak2){

		printf ("A\n");

	}



}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>



using namespace std;



int main(){

    int x,a,b;

    cin >> x >> a >> b;

    a=abs(a-x);

    b=abs(b-x);

    if (a>b){

        cout << "B" << " ";

    }

    else if (b>a){

        cout << "A" << " ";

    }

    else {

        cout << "A" ;

    }

    return 0;

}









/*#include <iostream>



using namespace std;



int main() {

        int a,b;

        cin >> a >> b;

        b*=2;

        b-=a;

        cout << b ;

    return 0;

}*/


// Faster C++ solution for the same problem (measured speedup: 5.29647402558911x):
#include <stdio.h>



int main (){

	int input[100];

	for (int a=0;a<3;a++){

		scanf ("%d",&input[a]);

	}

	int jarak1=input[0]-input[1];

	int jarak2=input[0]-input[2];

	if (jarak1<0){

		jarak1*=-1;

	}

	if (jarak2<0){

		jarak2*=-1;

	}

	if(jarak2<jarak1){

		printf ("B\n");

	}

	else if (jarak1<jarak2){

		printf ("A\n");

	}



}
// Slower C++ solution:
#include <iostream>

typedef long long int ll;

using namespace std;

ll a,b,i,j,x,y,n,m;

ll arr[1000];

int main()

{

    cin >> a >> n >> m;

    x = a-n;

    y = a-m;

    if (x<0)

        x*=-1;

    if (y<0)

        y*=-1;



    if (x>y)

        cout << "B\n";

    else

        cout << "A\n";







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.294215351035249x):
#include <stdio.h>



int main (){

	int input[100];

	for (int a=0;a<3;a++){

		scanf ("%d",&input[a]);

	}

	int jarak1=input[0]-input[1];

	int jarak2=input[0]-input[2];

	if (jarak1<0){

		jarak1*=-1;

	}

	if (jarak2<0){

		jarak2*=-1;

	}

	if(jarak2<jarak1){

		printf ("B\n");

	}

	else if (jarak1<jarak2){

		printf ("A\n");

	}



}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

    int main()

    {

        int x,a,b;

        cin>>x>>a>>b;



        if(abs(x - a) < abs(x - b))

           cout<<"A";

           else

            cout<<"B";

    }


// Faster C++ solution for the same problem (measured speedup: 5.295933242418894x):
#include <stdio.h>



int main (){

	int input[100];

	for (int a=0;a<3;a++){

		scanf ("%d",&input[a]);

	}

	int jarak1=input[0]-input[1];

	int jarak2=input[0]-input[2];

	if (jarak1<0){

		jarak1*=-1;

	}

	if (jarak2<0){

		jarak2*=-1;

	}

	if(jarak2<jarak1){

		printf ("B\n");

	}

	else if (jarak1<jarak2){

		printf ("A\n");

	}



}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

    int x, a, b;

    cin >> x >> a >> b;

    int diff_a = abs(x - a), diff_b = abs(x - b);

    if(diff_a < diff_b) cout << "A" << endl;

    else cout << "B" << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.309802779114393x):
#include<stdio.h>



int main(){

	int n, a, b;

	scanf("%d %d %d", &n, &a, &b);

	int tota = n-a;

	if(tota<0){

		tota*=-1;

	}

	int totb = n-b;

	if(totb<0){

		totb*=-1;

	}

	if(tota<totb){

		printf("A\n");

	}

	else if(totb<tota){

		printf("B\n");

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

    int x,a,b;

    scanf("%d %d %d",&x,&a,&b);

    if(abs(x-a)<abs(x-b))

        printf("A\n");

    else

        printf("B\n");







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.241688830219345x):
#include<stdio.h>



int main(){

	int n, a, b;

	scanf("%d %d %d", &n, &a, &b);

	int tota = n-a;

	if(tota<0){

		tota*=-1;

	}

	int totb = n-b;

	if(totb<0){

		totb*=-1;

	}

	if(tota<totb){

		printf("A\n");

	}

	else if(totb<tota){

		printf("B\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>



using namespace std;



int main(){

    int x,a,b;

    cin >> x >> a >> b;

    a=abs(a-x);

    b=abs(b-x);

    if (a>b){

        cout << "B" << " ";

    }

    else if (b>a){

        cout << "A" << " ";

    }

    else {

        cout << "A" ;

    }

    return 0;

}









/*#include <iostream>



using namespace std;



int main() {

        int a,b;

        cin >> a >> b;

        b*=2;

        b-=a;

        cout << b ;

    return 0;

}*/


// Faster C++ solution for the same problem (measured speedup: 5.298462821541208x):
#include<stdio.h>



int main(){

	int n, a, b;

	scanf("%d %d %d", &n, &a, &b);

	int tota = n-a;

	if(tota<0){

		tota*=-1;

	}

	int totb = n-b;

	if(totb<0){

		totb*=-1;

	}

	if(tota<totb){

		printf("A\n");

	}

	else if(totb<tota){

		printf("B\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

typedef long long int ll;

using namespace std;

ll a,b,i,j,x,y,n,m;

ll arr[1000];

int main()

{

    cin >> a >> n >> m;

    x = a-n;

    y = a-m;

    if (x<0)

        x*=-1;

    if (y<0)

        y*=-1;



    if (x>y)

        cout << "B\n";

    else

        cout << "A\n";







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.296203298867864x):
#include<stdio.h>



int main(){

	int n, a, b;

	scanf("%d %d %d", &n, &a, &b);

	int tota = n-a;

	if(tota<0){

		tota*=-1;

	}

	int totb = n-b;

	if(totb<0){

		totb*=-1;

	}

	if(tota<totb){

		printf("A\n");

	}

	else if(totb<tota){

		printf("B\n");

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

    int main()

    {

        int x,a,b;

        cin>>x>>a>>b;



        if(abs(x - a) < abs(x - b))

           cout<<"A";

           else

            cout<<"B";

    }


// Faster C++ solution for the same problem (measured speedup: 5.297921835309979x):
#include<stdio.h>



int main(){

	int n, a, b;

	scanf("%d %d %d", &n, &a, &b);

	int tota = n-a;

	if(tota<0){

		tota*=-1;

	}

	int totb = n-b;

	if(totb<0){

		totb*=-1;

	}

	if(tota<totb){

		printf("A\n");

	}

	else if(totb<tota){

		printf("B\n");

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

    int x, a, b;

    cin >> x >> a >> b;

    int diff_a = abs(x - a), diff_b = abs(x - b);

    if(diff_a < diff_b) cout << "A" << endl;

    else cout << "B" << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.310118661966527x):
#include <stdio.h>





int main()

{



int a, b, x, xtoa,xtob;



scanf("%d %d %d",&x, &a, &b);





		xtoa=x-a;

		if(xtoa<0){

			xtoa=xtoa*-1;

		}

		xtob=x-b;

		if(xtob<0){

			xtob=xtob*-1;

		}



	if(xtoa>xtob)

	{

		printf("B");

	}

	else if(xtoa<xtob) {

	

		printf("A");

	}



return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

    int x,a,b;

    scanf("%d %d %d",&x,&a,&b);

    if(abs(x-a)<abs(x-b))

        printf("A\n");

    else

        printf("B\n");







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.242000660938218x):
#include <stdio.h>





int main()

{



int a, b, x, xtoa,xtob;



scanf("%d %d %d",&x, &a, &b);





		xtoa=x-a;

		if(xtoa<0){

			xtoa=xtoa*-1;

		}

		xtob=x-b;

		if(xtob<0){

			xtob=xtob*-1;

		}



	if(xtoa>xtob)

	{

		printf("B");

	}

	else if(xtoa<xtob) {

	

		printf("A");

	}



return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>



using namespace std;



int main(){

    int x,a,b;

    cin >> x >> a >> b;

    a=abs(a-x);

    b=abs(b-x);

    if (a>b){

        cout << "B" << " ";

    }

    else if (b>a){

        cout << "A" << " ";

    }

    else {

        cout << "A" ;

    }

    return 0;

}









/*#include <iostream>



using namespace std;



int main() {

        int a,b;

        cin >> a >> b;

        b*=2;

        b-=a;

        cout << b ;

    return 0;

}*/


// Faster C++ solution for the same problem (measured speedup: 5.2987780297735325x):
#include <stdio.h>





int main()

{



int a, b, x, xtoa,xtob;



scanf("%d %d %d",&x, &a, &b);





		xtoa=x-a;

		if(xtoa<0){

			xtoa=xtoa*-1;

		}

		xtob=x-b;

		if(xtob<0){

			xtob=xtob*-1;

		}



	if(xtoa>xtob)

	{

		printf("B");

	}

	else if(xtoa<xtob) {

	

		printf("A");

	}



return 0;

}
// Slower C++ solution:
#include <iostream>

typedef long long int ll;

using namespace std;

ll a,b,i,j,x,y,n,m;

ll arr[1000];

int main()

{

    cin >> a >> n >> m;

    x = a-n;

    y = a-m;

    if (x<0)

        x*=-1;

    if (y<0)

        y*=-1;



    if (x>y)

        cout << "B\n";

    else

        cout << "A\n";







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.296518372680042x):
#include <stdio.h>





int main()

{



int a, b, x, xtoa,xtob;



scanf("%d %d %d",&x, &a, &b);





		xtoa=x-a;

		if(xtoa<0){

			xtoa=xtoa*-1;

		}

		xtob=x-b;

		if(xtob<0){

			xtob=xtob*-1;

		}



	if(xtoa>xtob)

	{

		printf("B");

	}

	else if(xtoa<xtob) {

	

		printf("A");

	}



return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

    int main()

    {

        int x,a,b;

        cin>>x>>a>>b;



        if(abs(x - a) < abs(x - b))

           cout<<"A";

           else

            cout<<"B";

    }


// Faster C++ solution for the same problem (measured speedup: 5.298237011358758x):
#include <stdio.h>





int main()

{



int a, b, x, xtoa,xtob;



scanf("%d %d %d",&x, &a, &b);





		xtoa=x-a;

		if(xtoa<0){

			xtoa=xtoa*-1;

		}

		xtob=x-b;

		if(xtob<0){

			xtob=xtob*-1;

		}



	if(xtoa>xtob)

	{

		printf("B");

	}

	else if(xtoa<xtob) {

	

		printf("A");

	}



return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

    int x, a, b;

    cin >> x >> a >> b;

    int diff_a = abs(x - a), diff_b = abs(x - b);

    if(diff_a < diff_b) cout << "A" << endl;

    else cout << "B" << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.321539329667414x):
#include <stdio.h>



int main() {

  int z, A, B;

  scanf("%d %d %d", &z, &A, &B);

  int distA = (z > A) ? z - A : A - z;

  int distB = (z > B) ? z - B : B - z;

  (distA < distB) ? puts("A") : puts("B");

  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

    int x,a,b;

    scanf("%d %d %d",&x,&a,&b);

    if(abs(x-a)<abs(x-b))

        printf("A\n");

    else

        printf("B\n");







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.253274824746495x):
#include <stdio.h>



int main() {

  int z, A, B;

  scanf("%d %d %d", &z, &A, &B);

  int distA = (z > A) ? z - A : A - z;

  int distB = (z > B) ? z - B : B - z;

  (distA < distB) ? puts("A") : puts("B");

  return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>



using namespace std;



int main(){

    int x,a,b;

    cin >> x >> a >> b;

    a=abs(a-x);

    b=abs(b-x);

    if (a>b){

        cout << "B" << " ";

    }

    else if (b>a){

        cout << "A" << " ";

    }

    else {

        cout << "A" ;

    }

    return 0;

}









/*#include <iostream>



using namespace std;



int main() {

        int a,b;

        cin >> a >> b;

        b*=2;

        b-=a;

        cout << b ;

    return 0;

}*/


// Faster C++ solution for the same problem (measured speedup: 5.310174306759251x):
#include <stdio.h>



int main() {

  int z, A, B;

  scanf("%d %d %d", &z, &A, &B);

  int distA = (z > A) ? z - A : A - z;

  int distB = (z > B) ? z - B : B - z;

  (distA < distB) ? puts("A") : puts("B");

  return 0;

}
// Slower C++ solution:
#include <iostream>

typedef long long int ll;

using namespace std;

ll a,b,i,j,x,y,n,m;

ll arr[1000];

int main()

{

    cin >> a >> n >> m;

    x = a-n;

    y = a-m;

    if (x<0)

        x*=-1;

    if (y<0)

        y*=-1;



    if (x>y)

        cout << "B\n";

    else

        cout << "A\n";







    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.3079097897380585x):
#include <stdio.h>



int main() {

  int z, A, B;

  scanf("%d %d %d", &z, &A, &B);

  int distA = (z > A) ? z - A : A - z;

  int distB = (z > B) ? z - B : B - z;

  (distA < distB) ? puts("A") : puts("B");

  return 0;

}