#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{
int n,q;
int vc[110];
while(cin>>n>>q)
{
memset(vc,-1,sizeof(vc));
while(q--)
{
int t,a,b;
cin>>t;
if(t==1)
{
cin>>a>>b;
vc[a]=b;
}
else
{
cin>>a;
if(vc[a]!=-1)
cout<<vc[a]<<endl;
else
cout<<"UMR!!!"<<endl;
}
}
}
}