#include <bits/stdc++.h>
using namespace std;
int fact[100005];
void criba() {
  for (int i = 2; i * i < 100005; i++)
    if (fact[i] == 0)
      for (int j = i * i; j < 100005; j += i) fact[j] = i;
  for (int i = 2; i < 100005; i++)
    if (fact[i] == 0) fact[i] = i;
}
bool vis[100005];
set<pair<int, int> > S;
int process(int n, int id) {
  int m = n;
  set<pair<int, int> >::iterator it;
  while (n > 1) {
    int f = fact[n];
    while (n % f == 0) n /= f;
    if (id == 2) {
      it = S.lower_bound(make_pair(f, -1));
      if (it != S.end() && (*it).first == f) return (*it).second;
    } else {
      if (id == 0)
        S.erase(make_pair(f, m));
      else
        S.insert(make_pair(f, m));
    }
  }
  return -1;
}
int main() {
  criba();
  int n, m;
  while (cin >> n >> m) {
    char op[2];
    int x;
    for (int i = 0; i < m; i++) {
      scanf("%s%d", op, &x);
      if (op[0] == '-') {
        if (vis[x])
          process(x, 0), puts("Success"), vis[x] = false;
        else
          puts("Already off");
      } else {
        if (vis[x])
          puts("Already on");
        else {
          int num = process(x, 2);
          if (num == -1)
            puts("Success"), process(x, 1), vis[x] = true;
          else
            printf("Conflict with %d\n", num);
        }
      }
    }
  }
}
