#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#define p_b push_back
#define rep(i, s, t) for(i = s; i <= t; ++i)
#define dep(i, s, t) for(i = s; i >= t; --i)

using namespace std;

const int N = 1010;
int n, m;
vector<int> e[N], id[N], _e[N], _id[N];
int p[2][N]; bool w[N];
bool ans[200010];

void dfs(int u, int id, int o) {
	p[o][u] = id;
	for(int i = 0; i < e[u].size(); ++i)
		if(!p[o][e[u][i]]) dfs(e[u][i], id, o);
}

void dfs2(int u) {
	w[u] = 1;
	for(int i = 0; i < e[u].size(); ++i)
		if(!w[e[u][i]]) dfs2(e[u][i]);
}

int main() {
	int i, j, x, y;
	scanf("%d%d", &n, &m);
	rep(i, 1, m) {
		scanf("%d%d", &x, &y);
		e[x].p_b(y); id[x].p_b(i);
		_e[y].p_b(x); _id[y].p_b(i);
	}
	rep(i, 1, n) {
		memset(p, 0, sizeof p);
		p[0][i] = p[1][i] = n+1;
		for(j = 0; j < e[i].size(); ++j)
			if(!p[0][e[i][j]]) dfs(e[i][j], id[i][j], 0);
		for(j = e[i].size()-1u; ~j; --j)
			if(!p[1][e[i][j]]) dfs(e[i][j], id[i][j], 1);
//		rep(j, 1, n) printf("%d ", p[0][j]); puts("");
//		rep(j, 1, n) printf("%d ", p[1][j]); puts("");
		
		for(j = 0; j < e[i].size(); ++j)
		if(p[0][e[i][j]] != id[i][j] || p[1][e[i][j]] != id[i][j]) ans[id[i][j]] ^= 1;
	}
	rep(i, 1, n) {
		memset(w, 0, sizeof w);
		dfs2(i);
		
		for(j = 0; j < _e[i].size(); ++j)
		if(w[_e[i][j]]) ans[_id[i][j]] ^= 1;
	}
	rep(i, 1, m)
	if(ans[i]) puts("diff"); else puts("same");
	return 0;
}