#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5 + 2, mod = 1e9 + 7, inf = 2e9;
struct edge_list {
  int u, v, pre;
} edge[N];
bool reachable, vis[N];
int n, m, ban, t, head[N];
void dfs(int v) {
  vis[v] = 1;
  if (v == t) {
    reachable = 1;
  }
  for (int i = head[v]; i; i = edge[i].pre) {
    int u = edge[i].v;
    if (i == 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]};
    head[u] = i;
  }
  for (int i = 1; i <= m; i++) {
    int u = edge[i].u, v = edge[i].v, ans;
    t = v, ban = i, reachable = 0, memset(vis, 0, sizeof vis);
    dfs(u), ans = reachable;
    t = u, ban = i, reachable = 0, memset(vis, 0, sizeof vis);
    dfs(v), ans ^= reachable;
    cout << (ans ? "diff" : "same") << '\n';
  }
}
