#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=105;
const int inf=0x3f3f3f3f;
int p[maxn];
int main()
{
int x,n,q,a,b;
while(~scanf("%d%d",&n,&q))
{
memset(p,-1,sizeof p);
for(int i=1;i<=q;i++)
{
scanf("%d %d",&x,&a);
if(x==1)
{
scanf("%d",&b);
p[a]=b;
}
else
{
if(p[a]==-1) printf("UMR!!!\n");
else printf("%d\n",p[a]);
}
}
}
}