#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
bool on[100002] = {};
vector<int> pr_f[100002] = {};
set<int> ac[100002] = {};
string s = "", ss = "";
int n, m, k, w;
int ans, ans1;
long long mod = 1e9 + 7;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int t = 1;
  while (t--) {
    for (long long i = 2; i < 1e5 + 1; i++) {
      if (!pr_f[i].size()) {
        int j = i;
        while (j <= 1e5) pr_f[j].push_back(i), j += i;
      }
    }
    cin >> n >> m;
    while (m--) {
      char c;
      cin >> c >> n;
      if (c == '+') {
        if (on[n]) {
          cout << "Already on\n";
          continue;
        }
        bool ch = 0;
        for (long long i = 0; i < pr_f[n].size(); i++)
          if (ac[pr_f[n][i]].size()) {
            cout << "Conflict with " << *ac[pr_f[n][i]].begin() << "\n";
            ch = 1;
            break;
          }
        if (ch) continue;
        for (long long i = 0; i < pr_f[n].size(); i++) ac[pr_f[n][i]].insert(n);
        on[n] = 1;
        cout << "Success\n";
      } else {
        if (!on[n]) {
          cout << "Already off\n";
          continue;
        }
        on[n] = 0;
        for (long long i = 0; i < pr_f[n].size(); i++) ac[pr_f[n][i]].erase(n);
        cout << "Success\n";
      }
    }
  }
  return 0;
}
