http://acm.nefu.edu.cn/JudgeOnline/problemshow.php?problem_id=553
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn=1e4;
int data[maxn];
int main()
{
int m,k;
while(~scanf("%d%d",&m,&k))
{
for(int i=0; i<m; i++)
scanf("%d",&data[i]);
sort(data,data+m) ;
int sum=data[m-k]-data[k-1];
if(sum&1)
puts("A");
else
puts("B");
}
return 0;
}