#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
void JIZZ() {
  cout << "";
  exit(0);
}
const long double PI = 3.14159265358979323846264338327950288;
const long double eps = 1e-13;
const long long mod = 1e9 + 7;
bitset<100005> _p;
vector<int> p;
void init() {
  for (int i = 2; i < 100000; ++i) {
    if (_p[i]) continue;
    p.push_back(i);
    for (long long j = i * 1ll * i; j < 100000; j += i) {
      _p[j] = 1;
    }
  }
}
int decom[100005];
void tetteterette(int x) {
  int ptr = 0;
  for (long long i : p) {
    if (x % i == 0) {
      while (x % i == 0) x /= i;
      decom[ptr++] = i;
    }
    if (i * i > x) break;
  }
  if (x != 1) decom[ptr++] = x;
  decom[ptr] = -1;
}
int col[100005];
int now[100005];
int main() {
  init();
  int n, m;
  cin >> n >> m;
  while (m--) {
    string ope;
    int num;
    cin >> ope >> num;
    if (ope[0] == '+') {
      if (now[num])
        cout << "Already on" << endl;
      else {
        tetteterette(num);
        int colnum = -1;
        for (int i = 0; decom[i] != -1; ++i) {
          if (col[decom[i]]) {
            colnum = col[decom[i]];
            break;
          }
        }
        if (~colnum)
          cout << "Conflict with " << colnum << endl;
        else {
          for (int i = 0; decom[i] != -1; ++i) {
            col[decom[i]] = num;
          }
          now[num] = 1;
          cout << "Success" << endl;
        }
      }
    } else {
      if (!now[num])
        cout << "Already off" << endl;
      else {
        tetteterette(num);
        for (int i = 0; decom[i] != -1; ++i) {
          col[decom[i]] = 0;
        }
        now[num] = 0;
        cout << "Success" << endl;
      }
    }
  }
}
