// Problem: A. Founder DNA Match – The Human Capital Engine
// Contest: Codeforces - ECPC 2025 (Mirror)
// URL: https://c...content-available-to-author-only...s.com/group/Rilx5irOux/contest/628229/problem/A
// Memory Limit: 256 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://c...content-available-to-author-only...r.org)

#include <bits/stdc++.h>
using namespace std;

bool multicases_=false;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// template<class  T>using ordered_multiset = tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<typename T>using ordered_multiset = tree<pair<T, int>, null_type, less<pair<T, int>>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

using ll = long long;
#define int long long//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<??
typedef unsigned long long u64;//this or the one  below
#define ull unsigned long long

void pre_compute(){
	
}

void solve(int tc){
	// //dbg:
	 // cerr<<"at the test case no."<<tc<<" : \n";
	
	int n; cin>>n;
	int arr[2]={0,0};
	
	/////////// h,q;//happiness change(increase/decrease)  ,,     quantity
	vector<pair<int,int>>v(n);
	for(auto&[h,q]:v){
		cin>>h>>q;
		h=(h==1?1:-1);
		
	}
	
	int turn=1;
	for(auto&[h,q]:v){
		
		if(turn==1){
			arr[0]+=h*q;
			if(arr[0]<0)return void(cout<<"AHMED");
		} else {
			arr[1]+=h*q;
			if(arr[1]<0)return void(cout<<"AMIRA");
		}
		
		
		turn*=-1;
		
		//dbg
		// cerr<<arr[0]<<' '<<arr[1]<<'\n';
		
	}
	cout<<"DRAW";
}

signed main(){
	ios::sync_with_stdio(0);cin.tie(0);
	
	pre_compute();
	
	int tc=1;
	if(multicases_)cin>>tc;
	int total_tcs=tc;
	while(tc--){
		solve(total_tcs-tc);
	}
	return 0;
}