#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cctype>
#include <algorithm>
#include <functional>
#include <utility>
#include <vector>
const int maxn = 1005;
const int maxm = 200005;
std::vector<int> G[maxn], RG[maxn];
inline void ins_edge(int u, int v) {
  G[u].push_back(v);
  RG[v].push_back(u);
}

bool rvis[maxn];
void dfs_r(int x) {
  rvis[x] = true;
  for(int v : RG[x]) {
    if(!rvis[v]) {
      dfs_r(v);
    }
  }
}

int typ[maxn][2];
void dfs_t(int x, int bg) {
  if(typ[x][0]) {
    typ[x][1] = bg;
  } else {
    typ[x][0] = bg;
  }
  for(int v : G[x]) {
    if(!typ[v][1] && typ[v][0] != bg) {
      dfs_t(v, bg);
    }
  }
}

int E[maxm][2];
int flag[maxn][maxn];
inline void deal(int s) {
  memset(rvis, 0, sizeof(rvis));
  dfs_r(s);
  for(int v : G[s]) {
    if(rvis[v]) {
#ifdef LOCAL
      printf("Edge (%d, %d) type 1\n", s, v);
#endif
      flag[s][v] ^= 1;
    }
  }
  memset(typ, 0, sizeof(typ));
  typ[s][0] = typ[s][1] = 0x7f7f7f7f;
  for(int v : G[s]) {
    dfs_t(v, v);
  }
  for(int v : G[s]) {
    if(typ[v][1]) {
#ifdef LOCAL
      printf("Edge (%d, %d) type 2(%d, %d)\n", s, v, typ[v][0], typ[v][1]);
#endif
      flag[s][v] ^= 1;
    }
  }
}

int main() {
  int n, m; scanf("%d%d", &n, &m);
  for(int i = 1; i <= m; i ++) {
    int u, v; scanf("%d%d", &u, &v);
    E[i][0] = u; E[i][1] = v;
    ins_edge(u, v);
  }
  for(int i = 1; i <= n; i ++) deal(i);
  for(int i = 1; i <= m; i ++) {
    const int u = E[i][0], v = E[i][1];
    if(flag[u][v]) {
      puts("diff");
    } else {
      puts("same");
    }
  }
  return 0;
}