#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
template <typename T>
void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
void chkmin(T &x, T y) {
  x = min(x, y);
}
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -f;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  x *= f;
}
template <typename T>
void write(T x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
void writeln(T x) {
  write(x);
  puts("");
}
struct edge {
  int dest, home;
};
int n, m;
int pre[MAXN], suf[MAXN];
bool vis[MAXN][MAXN], ans[MAXN];
vector<edge> a[MAXN];
void dfs(int from, int pos) {
  vis[from][pos] = true;
  for (unsigned i = 0; i < a[pos].size(); i++)
    if (!vis[from][a[pos][i].dest]) dfs(from, a[pos][i].dest);
}
void dfspre(int pos, int val) {
  pre[pos] = val;
  for (unsigned i = 0; i < a[pos].size(); i++)
    if (pre[a[pos][i].dest] == -1) dfspre(a[pos][i].dest, val);
}
void dfssuf(int pos, int val) {
  suf[pos] = val;
  for (unsigned i = 0; i < a[pos].size(); i++)
    if (suf[a[pos][i].dest] == -1) dfssuf(a[pos][i].dest, val);
}
int main() {
  read(n), read(m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    read(x), read(y);
    a[x].push_back((edge){y, i});
  }
  for (int i = 1; i <= n; i++) dfs(i, i);
  for (int i = 1; i <= n; i++)
    for (unsigned j = 0; j < a[i].size(); j++)
      if (vis[a[i][j].dest][i]) ans[a[i][j].home] ^= true;
  for (int i = 1; i <= n; i++) {
    memset(pre, -1, sizeof(pre));
    memset(suf, -1, sizeof(suf));
    pre[i] = suf[i] = 0;
    for (unsigned j = 0; j < a[i].size(); j++)
      if (pre[a[i][j].dest] == -1) dfspre(a[i][j].dest, j);
    for (unsigned j = a[i].size(); j > 0; j--)
      if (suf[a[i][j - 1].dest] == -1) dfssuf(a[i][j - 1].dest, j - 1);
    for (unsigned j = 0; j < a[i].size(); j++)
      if (pre[a[i][j].dest] != suf[a[i][j].dest]) ans[a[i][j].home] ^= true;
  }
  for (int i = 1; i <= m; i++)
    if (ans[i])
      printf("diff\n");
    else
      printf("same\n");
  return 0;
}
