#include <bits/stdc++.h>
using namespace std;
long long int pow_mod(long long int a, long long int b) {
  long long int res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
long long int nrst[100005];
bool mark[100005];
vector<long long int> prm;
void solve() {
  long long int n, m;
  cin >> n >> m;
  set<long long int> st[100005];
  long long int on[100005] = {0};
  while (m--) {
    char c;
    cin >> c;
    cin.ignore();
    long long int x;
    cin >> x;
    if (c == '+') {
      if (on[x]) {
        cout << "Already on\n";
        continue;
      }
      long long int z = x;
      bool f = false;
      while (x != 1) {
        long long int y = nrst[x];
        if (!st[y].empty()) {
          cout << "Conflict with " << (*st[y].begin()) << endl;
          f = true;
          break;
        }
        while (x % y == 0) x /= y;
      }
      if (!f) {
        cout << "Success\n";
        on[z] = 1;
        x = z;
        while (x != 1) {
          long long int y = nrst[x];
          while (x % y == 0) x /= y;
          st[y].insert(z);
        }
      }
    } else {
      if (!on[x]) {
        cout << "Already off\n";
        continue;
      } else {
        cout << "Success\n";
        on[x] = 0;
        long long int z = x;
        while (x != 1) {
          long long int y = nrst[x];
          st[y].erase(z);
          while (x % y == 0) x /= y;
        }
      }
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset(mark, true, sizeof(mark));
  mark[0] = mark[1] = false;
  nrst[1] = 1;
  for (long long int i = 2; i < 100005; i++) {
    if (mark[i]) {
      nrst[i] = i;
      for (long long int j = i * i; j < 100005; j += i) {
        if (mark[j]) {
          mark[j] = false;
          nrst[j] = i;
        }
      }
    }
  }
  long long int t;
  t = 1;
  while (t--) solve();
  return 0;
}
