#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(const T& x) {
  return x * x;
}
int n, m;
vector<int> f[100001];
vector<int> c[100001];
int tot_count[1000001];
map<int, set<int> > tot_who;
bool on[100001];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x;
    char op[4];
    scanf("%s%d", op, &x);
    if (op[0] == '+') {
      if (on[x]) {
        printf("Already on\n");
        continue;
      }
      int xx = x;
      map<int, int> mp;
      for (int j = 2; j * j <= x; j++) {
        while (x % j == 0) {
          if (tot_count[j]) {
            printf("Conflict with %d\n", *tot_who[j].begin());
            goto bad;
          }
          mp[j]++;
          x /= j;
        }
      }
      if (x > 1) {
        if (tot_count[x]) {
          printf("Conflict with %d\n", *tot_who[x].begin());
          goto bad;
        }
        mp[x]++;
      }
      for (__typeof(mp.begin()) it = (mp).begin(); it != (mp).end(); ++it) {
        tot_count[it->first] += it->second;
        tot_who[it->first].insert(xx);
      }
      printf("Success\n");
      on[xx] = true;
    bad:;
    } else {
      if (not on[x]) {
        printf("Already off\n");
        continue;
      }
      int xx = x;
      for (int j = 2; j * j <= x; j++) {
        int t = 0;
        while (x % j == 0) {
          t++;
          x /= j;
        }
        tot_count[j] -= t;
        tot_who[j].erase(xx);
      }
      if (x > 1) {
        --tot_count[x];
        tot_who[x].erase(xx);
      }
      on[xx] = false;
      printf("Success\n");
    }
  }
  return 0;
}
