#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1001, M = 2e5 + 2, mod = 1e9 + 7, inf = 2e9;
struct edge_list {
  int u, v, pre, nex;
} edge[M];
bool vis[N];
int n, m, ban, ans[M], cur[M], head[N], tail[N];
void dfs(int v) {
  vis[v] = 1;
  for (int i = head[v]; i; i = edge[i].pre) {
    int u = edge[i].v;
    if (u == ban || vis[u]) continue;
    dfs(u);
  }
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1, u, v; i <= m; i++) {
    cin >> u >> v;
    edge[i] = {u, v, head[u], 0};
    head[u] = i;
  }
  for (int i = m; i >= 1; i--) {
    int u = edge[i].u;
    edge[i].nex = tail[u];
    tail[u] = i;
  }
  for (int i = 1; i <= n; i++) {
    memset(vis, 0, sizeof vis);
    ban = 0;
    dfs(i);
    for (int j = 1; j <= m; j++) {
      int u = edge[j].u, v = edge[j].v;
      if (v == i) ans[j] ^= vis[u];
    }
    ban = i;
    memset(vis, 0, sizeof vis);
    for (int j = head[i]; j; j = edge[j].pre) {
      int u = edge[j].v;
      cur[j] |= vis[u];
      dfs(u);
    }
  }
  for (int i = 1; i <= m; i++) {
    puts(ans[i] ? "diff" : "same");
  }
}
