#include <bits/stdc++.h>
using namespace std;
void File() {
  freopen("ARC92F.in", "r", stdin);
  freopen("ARC92F.out", "w", stdout);
}
const int maxn = 1000 + 10;
const int maxm = 200000 + 10;
int n, m, beg[maxn], len;
bool can[maxn][maxn], can1[maxn][maxn], vis[maxn];
struct edge {
  int from;
  int to;
  int last;
} E[maxm];
void add(int u, int v) {
  ++len;
  E[len].from = u;
  E[len].to = v;
  E[len].last = beg[u];
  beg[u] = len;
}
void dfs(int u, int rt) {
  vis[u] = 1;
  can[rt][u] = 1;
  for (register int i = beg[u]; i; i = E[i].last) {
    int v = E[i].to;
    if (vis[v]) continue;
    dfs(v, rt);
  }
}
bool flag;
void dfs1(int u, int e, int rt) {
  vis[u] = 1;
  for (register int i = beg[u]; i; i = E[i].last) {
    if (flag) return;
    int v = E[i].to;
    if (i == e) continue;
    if (v == E[e].to) {
      can1[rt][v] = 1;
      flag = 1;
    }
    if (vis[v]) continue;
    dfs1(v, e, rt);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
  }
  for (register int i = 1; i <= n; ++i) {
    memset(vis, 0, sizeof(vis));
  }
  for (register int i = 1; i <= m; ++i) {
    memset(vis, 0, sizeof(vis));
    flag = 0;
  }
  for (register int i = 1; i <= m; ++i) {
    int u = E[i].from, v = E[i].to;
    if ((can[v][u] ^ can1[u][v]) == 0)
      puts("same");
    else
      puts("diff");
  }
  return 0;
}
