#include <bits/stdc++.h>
using namespace std;
bool b[100007];
map<long long, bool> on;
map<long long, long long> al;
long long j = 1, a[100007], px;
void sieve(long long n) {
  b[2] = 1;
  for (long long i = 3; i <= n; i += 2) b[i] = 1;
  for (long long i = 3; i * i <= n; i += 2) {
    if (b[i]) {
      for (long long j = 3 * i; j <= n; j += 2 * i) {
        b[j] = 0;
      }
    }
  }
  a[0] = 2;
  for (long long i = 3; i <= 100007; i += 2) {
    if (b[i]) {
      a[j++] = i;
    }
  }
}
long long checkk(long long x) {
  if (x == px) return 0;
  if (on[al[x]]) return al[x];
  if (b[x]) {
    al[x] = x;
    return 0;
  }
  long long xx = x;
  for (long long i = 0; 2 * a[i] <= x; i++) {
    if (x % a[i] == 0 and on[al[a[i]]] == 1) return al[a[i]];
    if (x % a[i] == 0 and on[al[x / a[i]]] == 1) return al[x / a[i]];
  }
  for (long long i = 2; i <= x; i++) {
    if (x % i == 0) al[i] = xx;
    while (x % i == 0) x /= i;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  char c;
  long long n, m, x;
  cin >> n >> m;
  sieve(100007);
  for (long long i = 1; i <= m; i++) {
    cin >> c >> x;
    if (c == '+') {
      if (on[x] == 1) {
        cout << "Already on\n";
        continue;
      }
      long long y = checkk(x);
      if (y) {
        cout << "Conflict with " << y;
        cout << "\n";
        continue;
      }
      on[x] = 1;
      cout << "Success\n";
      if (x != px) px = 0;
    } else {
      if (on[x] == 0) {
        cout << "Already off\n";
        continue;
      }
      on[x] = 0;
      px = x;
      cout << "Success\n";
    }
  }
  return 0;
}
