#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100001;
long long spf[MAXN];
bool vis[MAXN + 5] = {false};
long long freq[MAXN + 5] = {0};
set<long long> br[MAXN + 5];
void sieve() {
  spf[1] = 1;
  for (long long i = 2; i < MAXN; i++) spf[i] = i;
  for (long long i = 4; i < MAXN; i += 2) spf[i] = 2;
  for (long long i = 3; i * i < MAXN; i++) {
    if (spf[i] == i) {
      for (long long j = i * i; j < MAXN; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
int main() {
  sieve();
  long long n, m, a, b, p;
  cin >> n >> m;
  char ch;
  while (m--) {
    cin >> ch >> a;
    b = a;
    if (ch == '+') {
      if (vis[a] == true) {
        cout << "Already on\n";
        continue;
      }
      bool fg = true;
      while (a > 1) {
        p = spf[a];
        if (freq[p] != 0) {
          fg = false;
          set<long long>::iterator itr = br[p].begin();
          cout << "Conflict with " << (*itr) << "\n";
          break;
        }
        while (a % p == 0) a /= p;
      }
      a = b;
      if (!fg) continue;
      vis[b] = true;
      while (b > 1) {
        p = spf[b];
        br[p].insert(a);
        freq[p]++;
        while (b % p == 0) b /= p;
      }
      cout << "Success\n";
    } else {
      if (vis[a] == false) {
        cout << "Already off\n";
        continue;
      }
      vis[a] = false;
      while (a > 1) {
        p = spf[a];
        set<long long>::iterator itr = br[p].find(b);
        br[p].erase(itr);
        freq[p]--;
        while (a % p == 0) a /= p;
      }
      cout << "Success\n\n";
    }
  }
}
