#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
inline void read(int &x)
{
	x=0;int f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
struct node{
	int nex,to,from;
}edge[200005];
int N,M;
int head[1005],tot;
inline void insert(int from,int to)
{
	edge[++tot].nex=head[from];
	head[from]=tot;
	edge[tot].to=to;
	edge[tot].from=from;
}
int mex[1005][1005];
void dfs(int v,int x)
{
	for(int i=head[x];i;i=edge[i].nex)
		if(mex[v][edge[i].to]<2)
		{
			mex[v][edge[i].to]++;
			dfs(v,edge[i].to);
		}
}
int main()
{
	read(N);read(M);
	int u,v;
	for(int i=1;i<=M;i++)
	{
		read(u);read(v);
		insert(u,v);
	} 
	for(int i=1;i<=N;i++)
		dfs(i,i);
	for(int i=1;i<=M;i++)
	{
		bool flag=0;
		if(mex[edge[i].from][edge[i].to]&&mex[edge[i].to][edge[i].from])
			if(mex[edge[i].from][edge[i].to]>=2)
				flag=1;
		if(!mex[edge[i].to][edge[i].from]&&mex[edge[i].from][edge[i].to]>=2)
			flag=1;
		if(flag)
			printf("diff\n");
		else
			printf("same\n");
	}
		
}