#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1LL;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
inline long long readll() {
  long long f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1LL;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
template <class T>
inline void chmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void chmin(T &a, T b) {
  if (a > b) a = b;
}
inline void swap(int &a, int &b) {
  int c = a;
  a = b;
  b = c;
}
using namespace std;
const int N = 1010;
const int M = 2e5 + 10;
struct node {
  int next, to, id;
} e[M << 1];
int head[N], cnt;
inline void add(int u, int v, int id) {
  e[cnt].id = id;
  e[cnt].to = v;
  e[cnt].next = head[u];
  head[u] = cnt++;
}
int n, m;
int rea[N][N], vis[N];
inline void dfs1(int x, int frm) {
  vis[x] = 1;
  rea[frm][x] = 1;
  for (int i = head[x]; ~i; i = e[i].next) {
    int v = e[i].to;
    if (vis[v]) continue;
    dfs1(v, frm);
  }
}
int p[N][N], q[N][N], col;
inline void dfs2(int x, int frm) {
  p[frm][x] = col;
  vis[x] = 1;
  for (int i = head[x]; ~i; i = e[i].next) {
    int v = e[i].to;
    if (vis[v]) continue;
    dfs2(v, frm);
  }
}
inline void dfs3(int x, int frm) {
  q[frm][x] = col;
  vis[x] = 1;
  for (int i = head[x]; ~i; i = e[i].next) {
    int v = e[i].to;
    if (vis[v]) continue;
    dfs3(v, frm);
  }
}
struct edge {
  int u, v, id;
} E[N];
int main() {
  memset(head, -1, sizeof(head));
  n = read();
  m = read();
  for (int i = (1); i <= (m); ++i) {
    int u = read(), v = read();
    add(u, v, i);
    E[i].id = i;
    E[i].u = u;
    E[i].v = v;
  }
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (n); ++j) vis[j] = 0;
    dfs1(i, i);
  }
  for (int x = (1); x <= (n); ++x) {
    vector<int> fk;
    for (int j = (1); j <= (n); ++j) vis[j] = 0;
    vis[x] = 1;
    for (int i = head[x]; ~i; i = e[i].next) {
      fk.push_back(i);
      col = e[i].id;
      int v = e[i].to;
      if (vis[v]) continue;
      dfs2(v, x);
    }
    reverse(fk.begin(), fk.end());
    for (int j = (1); j <= (n); ++j) vis[j] = 0;
    vis[x] = 1;
    for (auto i : fk) {
      col = e[i].id;
      int v = e[i].to;
      if (vis[v]) continue;
      dfs3(v, x);
    }
  }
  for (int i = (1); i <= (m); ++i) {
    int u = E[i].u, v = E[i].v;
    int k = rea[v][u];
    k ^= (p[u][v] != i || q[u][v] != i);
    if (k) {
      puts("diff");
    } else
      puts("same");
  }
  return 0;
}
