#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int xinc[] = {0, 0, 1, -1};
const int yinc[] = {1, -1, 0, 0};
const long double PI = acos(-1.0);
int n, m, on[N], x;
vector<int> pf[N];
char c;
bool prime[N];
void sv() {
  memset(prime, true, sizeof prime);
  for (int i = 2; i < N; i++)
    if (prime[i]) {
      pf[i].push_back(i);
      for (int j = 2 * i; j < N; j += i) prime[j] = false, pf[j].push_back(i);
    }
}
void solve() {
  sv();
  cin >> n >> m;
  set<int> se;
  map<int, int> no;
  for (int i = 0; i < m; i++) {
    cin >> c >> x;
    if (c == '+') {
      if (on[x]) {
        cout << "Already on" << '\n';
        continue;
      }
      bool valid = true;
      int cp = -1;
      for (auto pr : pf[x])
        if (se.find(pr) != se.end()) {
          valid = false;
          cp = pr;
          break;
        }
      if (!valid) {
        cout << "Conflict with " << no[cp] << '\n';
      } else {
        on[x] = true;
        for (auto pr : pf[x]) se.insert(pr), no[pr] = x;
        cout << "Success" << '\n';
      }
    } else {
      if (!on[x]) {
        cout << "Already off" << '\n';
        continue;
      }
      on[x] = 0;
      for (auto pr : pf[x]) se.erase(pr);
      cout << "Success" << '\n';
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}
