#include <bits/stdc++.h>
using namespace std;
set<int> factorize(int x) {
  int n = x;
  set<int> s;
  for (int i = 2; i * i <= n and x > 1; ++i)
    while (x % i == 0) s.insert(i), x /= i;
  if (x > 1) s.insert(x);
  return s;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<int> pf(n + 1);
  vector<bool> st(n + 1);
  while (m--) {
    char c;
    int x;
    cin >> c >> x;
    if (c == '+') {
      if (st[x]) {
        cout << "Already on" << '\n';
        continue;
      }
      auto fs = factorize(x);
      bool conflict = 0;
      for (int it : fs)
        if (pf[it]) {
          cout << "Conflict with " << pf[it] << '\n', conflict = 1;
          break;
        }
      if (conflict) continue;
      for (int it : fs) pf[it] = x;
      st[x] = 1;
      cout << "Success" << '\n';
    } else {
      bool on = 1;
      if (st[x]) {
        for (int it : factorize(x)) pf[it] = 0;
        st[x] = 0;
        cout << "Success" << '\n';
      } else
        cout << "Already off" << '\n';
    }
  }
  return 0;
}
