#include <bits/stdc++.h>
using namespace std;
const double PI = 4.0 * atan(1.0);
const int maxn = 100010;
int vis[maxn], ft[maxn], rem[maxn];
int n, m;
vector<int> ve;
int on(int x) {
  ve.clear();
  int tmp = x;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      if (ft[i]) return ft[i];
      ve.push_back(i);
      while (x % i == 0) x /= i;
    }
  }
  if (x != 1) {
    if (ft[x]) return ft[x];
    ve.push_back(x);
  }
  for (int i = 0; i < ve.size(); ++i) ft[ve[i]] = tmp;
  vis[tmp] = 1;
  return 0;
}
void off(int x) {
  int tmp = x;
  for (int i = 2; i * i <= x; ++i) {
    if (x % i == 0) {
      ft[i] = 0;
      while (x % i == 0) x /= i;
    }
  }
  if (x != 1) {
    ft[x] = 0;
  }
  vis[tmp] = 0;
}
int main() {
  while (scanf("%d%d", &n, &m) == 2) {
    memset(vis, 0, sizeof(vis));
    memset(ft, 0, sizeof(ft));
    char op;
    int num;
    for (int k = 0; k < m; ++k) {
      scanf(" %c %d", &op, &num);
      if (op == '+') {
        if (vis[num]) {
          printf("Already on\n");
          continue;
        }
        int ans = on(num);
        printf(ans ? "Conflict with %d\n" : "Success\n", ans);
      } else {
        if (!vis[num]) {
          printf("Already off\n");
          continue;
        }
        printf("Success\n");
        off(num);
      }
    }
  }
  return 0;
}
