#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 2100000000;
bool pr[N], is[N];
vector<int> primes;
vector<vector<int> > fact;
int has[N];
int main() {
  for (long long i = 2; i * i < N; ++i) {
    if (pr[i]) continue;
    primes.push_back(i);
    for (long long j = i * i; j < N; j += i) pr[j] = true;
  }
  memset(has, -1, sizeof(has));
  int n, m;
  cin >> n >> m;
  fact.resize(n + 1);
  for (int i = 1; i <= n; ++i) {
    int d = i;
    for (int j = 0; j < primes.size(); ++j) {
      if (d % primes[j] == 0) fact[i].push_back(primes[j]);
      while (d % primes[j] == 0) d /= primes[j];
    }
    if (d > 1) fact[i].push_back(d);
  }
  char c;
  for (int x, i = 0; i < m; ++i) {
    scanf(" %c %d", &c, &x);
    if (c == '+') {
      if (is[x]) {
        printf("Already on\n");
        continue;
      }
      bool f = false;
      for (int i = 0; i < fact[x].size(); ++i)
        if (has[fact[x][i]] != -1) {
          printf("Conflict with %d\n", has[fact[x][i]]);
          f = true;
          break;
        }
      if (f) continue;
      is[x] = true;
      for (int i = 0; i < fact[x].size(); ++i) has[fact[x][i]] = x;
      printf("Success\n");
    } else {
      if (!is[x]) {
        printf("Already off\n");
        continue;
      }
      is[x] = false;
      for (int i = 0; i < fact[x].size(); ++i) has[fact[x][i]] = -1;
      printf("Success\n");
    }
  }
}
