#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int n, m;
vector<int> divizori[100005];
set<int> poz[100005];
bool prim[100002];
void ciur() {
  for (int i = 2; i <= 100000; ++i)
    if (!prim[i])
      for (int j = i; j <= 100000; j += i) {
        prim[j] = 1;
        divizori[j].push_back(i);
      }
}
bool activ[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  ciur();
  for (int i = 1; i <= m; ++i) {
    char c;
    int nr;
    cin >> c >> nr;
    if (c == '-') {
      if (!activ[nr])
        cout << "Already off\n";
      else {
        cout << "Success\n";
        for (int j = 0; j < divizori[nr].size(); ++j)
          poz[divizori[nr][j]].erase(nr);
        activ[nr] = 0;
      }
    } else {
      if (activ[nr])
        cout << "Already on\n";
      else {
        bool bad = 0;
        int pozitie = 0;
        for (int j = 0; j < divizori[nr].size(); ++j)
          if (!poz[divizori[nr][j]].empty())
            bad = 1, pozitie = *poz[divizori[nr][j]].begin();
        if (bad)
          cout << "Conflict with " << pozitie << '\n';
        else {
          cout << "Success\n";
          activ[nr] = 1;
          for (int j = 0; j < divizori[nr].size(); ++j)
            poz[divizori[nr][j]].insert(nr);
        }
      }
    }
  }
  return 0;
}
