#include using namespace std; int T,n;long long h; long long d[100005]; long long mx[400005],lz[400005]; int A=0,B=0,tu=0; void pushdown(int o){ if(lz[o]){ mx[o<<1]+=lz[o],mx[o<<1|1]+=lz[o]; lz[o<<1]+=lz[o],lz[o<<1|1]+=lz[o]; lz[o]=0; } } void get(int l,int r,int o){ if(l==r){ if(mx[o]>=h){ mx[o]=-1e18; if(tu)++A; else ++B; } return; } pushdown(o); int mid=(l+r)>>1; if(mx[o<<1]>=h)get(l,mid,o<<1); if(mx[o<<1|1]>=h)get(mid+1,r,o<<1|1); mx[o]=max(mx[o<<1],mx[o<<1|1]); } void add(int l,int r,int o,int ll,int rr,int z){ if(l>=ll&&r<=rr){ mx[o]+=z;lz[o]+=z; if(mx[o]>=h)get(l,r,o); return; } pushdown(o); int mid=(l+r)>>1; if(mid>=ll)add(l,mid,o<<1,ll,rr,z); if(mid=h); if(tu==1)A+=he-ls; else B+=he-ls; ls=he; } puts(A>B?"A":A==B?"DRAW":"B"); printf("%d %d\n",A,B); return 0; }