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

typedef long long ll;
typedef pair<int,int> P;

#define fr first
#define sc second

int n,m;
int a[200010],b[200010];
vector<P> G[1002];

int ok[1002][1002];
void solve(int s){
	queue<P> que;
	int id[1002] = {};
	bool used[1002];
	for(int i = 0 ; i < 1002 ; i ++){
		used[i] = false;
	}
	id[s] = n+1;
	used[s] = true;
	for(int i = 0 ; i < G[s].size() ; i ++){
		int v = G[s][i].fr;
		id[v] = v;
		que.push(P(v,id[v]));
	}
	while(!que.empty()){
		P p = que.front(); que.pop();
		if(used[p.fr])continue;
		for(int i = 0 ; i < G[p.fr].size() ; i ++){
			P ed = G[p.fr][i];
			if(id[ed.fr] != n+1 && id[ed.fr] != p.sc){
				if(id[ed.fr] == 0){
					id[ed.fr] = p.sc;
					used[ed.fr] = false;
					que.push(P(ed.fr,id[ed.fr]));
				}
				else {
					id[ed.fr] = n+1;
					used[ed.fr] = false;
					que.push(P(ed.fr,id[ed.fr]));
				}
			}
		}
	}
	for(int i = 1 ; i <= n ; i ++){
		if(id[i] == 0)ok[s][i] = 0;
		else if(id[i] <= n)ok[s][i] = 1;
		else ok[s][i] = 2;
	}
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i = 0 ; i < m ; i ++){
		scanf("%d%d",&a[i],&b[i]);
		G[a[i]].push_back(P(b[i],i));
	}
	for(int i = 1 ; i <= n ; i ++){
		solve(i);
	}
	for(int i = 0 ; i < m ; i ++){
		int cnt = 0;
		if(ok[a[i]][b[i]] == 2)cnt ++;
		if(ok[b[i]][a[i]] >= 1)cnt ++;
		if(cnt == 1)puts("diff");
		else puts("same");
	}
}

