#include<iostream>
#include<queue>
using namespace std;
struct pp
{
int x,y,k,next;
}line[300001];
int n,m,i,x,y,k,link[1010];
char c;
queue<int> myqueue;
bool SPFA()
{
int i,h,k,d[1010],sum[1010];
bool used[1010];
for (i=1;i<=n;i++)
{
m++;
line[m].x=0; line[m].y=i; line[m].k=0;
line[m].next=link[0]; link[0]=m;
}
while (!myqueue.empty()) myqueue.pop();
memset(d,0x7F,sizeof(d));
memset(sum,0,sizeof(sum));
memset(used,false,sizeof(used));
d[0]=0; myqueue.push(0);
while (!myqueue.empty())
{
h=myqueue.front();
myqueue.pop();
used[h]=false;
k=link[h];
while (k)
{
if (d[line[k].y]>d[h]+line[k].k)
{
d[line[k].y]=d[h]+line[k].k;
if (!used[line[k].y])
{
myqueue.push(line[k].y);
sum[line[k].y]++;
if (sum[line[k].y]>n) return false;
used[line[k].y]=true;
}
}
k=line[k].next;
}
}
return true;
}
int main()
{
while (~scanf("%d%d",&n,&m))
{
i=m;
m=0;
memset(link,0,sizeof(link));
while (i--)
{
c=getchar();
while (c!='V' && c!='P' ) c=getchar(); ;
if (c=='P')
{
scanf("%d%d%d",&y,&x,&k);
m++;
line[m].x=x; line[m].y=y; line[m].k=k;
line[m].next=link[x]; link[x]=m;
m++;
line[m].x=y; line[m].y=x; line[m].k=-k;
line[m].next=link[y]; link[y]=m;
}else
{
scanf("%d%d",&x,&y);
m++;
line[m].x=x; line[m].y=y; line[m].k=-1;
line[m].next=link[x]; link[x]=m;
}
}
if (SPFA()) printf("Reliable\n");
else printf("Unreliable\n");
}
return 0;
}