#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
bool pri_p[maxn];
int used[maxn];
vector<int> num_div[maxn];
vector<int> pri;
set<int> on;
void creat() {
  for (int i = 2; i < maxn; i++) {
    if (!pri_p[i]) {
      pri.push_back(i);
      for (int j = 2 * i; j < maxn; j += i) pri_p[j] = true;
    }
  }
  for (int i = 2; i < maxn; i++) {
    int temp = i;
    for (int k = 0; pri[k] * pri[k] <= temp; k++) {
      if (temp % pri[k] == 0) num_div[i].push_back(pri[k]);
      while (temp % pri[k] == 0) temp /= pri[k];
    }
    if (!pri_p[temp] && temp != 1) num_div[i].push_back(temp);
  }
}
int main() {
  int n, m;
  int no;
  char temp;
  creat();
  cin >> n >> m;
  getchar();
  while (m--) {
    bool flag = false;
    scanf("%c %d", &temp, &no);
    int save = no;
    getchar();
    if (temp == '-') {
      if (on.count(no)) {
        puts("Success");
        on.erase(no);
        for (int i = 0; i < num_div[no].size(); i++) used[num_div[no][i]] = 0;
      } else
        puts("Already off");
    }
    if (temp == '+') {
      if (on.count(no)) {
        puts("Already on");
        continue;
      } else {
        for (int i = 0; i < num_div[no].size(); i++) {
          if (used[num_div[no][i]]) {
            flag = true;
            printf("Conflict with %d\n", used[num_div[no][i]]);
            break;
          }
        }
        if (flag) continue;
        puts("Success");
        on.insert(no);
        for (int i = 0; i < num_div[no].size(); i++) used[num_div[no][i]] = no;
      }
    }
  }
}
