#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int n, m;
bool prime[maxn + 100];
vector<int> d[maxn + 100];
set<int> S[maxn + 100];
bool on[maxn + 100];
int main() {
  scanf("%d%d\n", &n, &m);
  memset(prime, 1, sizeof(prime));
  for (int i = 2; i <= n; ++i)
    if (prime[i]) {
      d[i].push_back(i);
      for (int j = i + i; j <= n; j += i) {
        prime[j] = false;
        d[j].push_back(i);
      }
    }
  while (m--) {
    char ch;
    int num;
    scanf("%c %d\n", &ch, &num);
    if (ch == '+') {
      if (on[num]) {
        puts("Already on");
        continue;
      }
      int conf = -1;
      for (int i = 0; i < d[num].size(); ++i) {
        int x = d[num][i];
        if (!S[x].empty()) {
          conf = *(S[x].begin());
          break;
        }
      }
      if (conf != -1) {
        printf("Conflict with %d\n", conf);
        continue;
      }
      puts("Success");
      on[num] = true;
      for (int i = 0; i < d[num].size(); ++i) {
        int x = d[num][i];
        S[x].insert(num);
      }
    } else {
      if (!on[num]) {
        puts("Already off");
        continue;
      }
      puts("Success");
      on[num] = false;
      for (int i = 0; i < d[num].size(); ++i) {
        int x = d[num][i];
        S[x].erase(num);
      }
    }
  }
  return 0;
}
