#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int p[MAXN], s[MAXN], on[MAXN], onp[MAXN], valueon[MAXN];
int sieve(int n) {
  int k = 0;
  for (int i = 2; i <= n; i++) {
    if (p[i] == 0) {
      k++;
      s[k] = i;
      for (int j = 2 * i; j <= n; j = j + i) {
        p[j] = 1;
      }
    }
  }
  return k;
}
void mark(int x, int value, int slen) {
  int sqr = sqrt(x), aux = x;
  for (int i = 1; i <= slen && s[i] <= sqr; i++) {
    if (x % s[i] == 0) {
      onp[s[i]] = value;
      valueon[s[i]] = aux;
      while (x % s[i] == 0) {
        x = x / s[i];
      }
    }
  }
  if (x != 1) {
    onp[x] = value;
    valueon[x] = aux;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  int slen = sieve(n);
  for (int i = 1; i <= m; i++) {
    char c;
    int x;
    cin >> c >> x;
    if (c == '+') {
      if (on[x]) {
        cout << "Already on" << '\n';
        continue;
      }
      int sqr = sqrt(x);
      int aux = x;
      int ok = 1;
      for (int i = 1; i <= slen && s[i] <= sqr; i++) {
        if (x % s[i] == 0) {
          if (onp[s[i]]) {
            cout << "Conflict with " << valueon[s[i]] << '\n';
            ok = 0;
            break;
          } else {
            while (x % s[i] == 0) {
              x = x / s[i];
            }
          }
        }
      }
      if (ok == 1) {
        if (x != 1 && onp[x]) {
          cout << "Conflict with " << valueon[x] << '\n';
        } else {
          cout << "Success" << '\n';
          on[aux] = 1;
          mark(aux, 1, slen);
        }
      }
    } else {
      if (on[x] == 0) {
        cout << "Already off" << '\n';
      } else {
        cout << "Success" << '\n';
        on[x] = 0;
        mark(x, 0, slen);
      }
    }
  }
  return 0;
}
