#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000000007;
const int maxn = 1e5 + 50;
const int INF = 0x3f3f3f3f;
int C[maxn];
vector<int> p[maxn];
bool on[maxn];
int n, m;
void init() {
  for (int i = 1; i <= n; i++) {
    p[i].clear();
    if (i == 1) continue;
    int sq = sqrt(i), t = i;
    for (int j = 2; j <= sq; j++) {
      if (t % j == 0) {
        p[i].push_back(j);
        while (t % j == 0) t /= j;
      }
    }
    if (t > 1) p[i].push_back(t);
  }
}
void work(char c, int t) {
  if (c == '+' && on[t] == 1) {
    puts("Already on");
    return;
  }
  if (c == '-' && on[t] == 0) {
    puts("Already off");
    return;
  }
  int sz = p[t].size(), tmp;
  if (c == '+') {
    for (int i = 0; i < sz; i++) {
      tmp = p[t][i];
      if (C[tmp]) {
        printf("Conflict with %d\n", C[tmp]);
        return;
      }
    }
    for (int i = 0; i < sz; i++) {
      tmp = p[t][i];
      C[tmp] = t;
    }
    on[t] = 1;
    puts("Success");
  } else {
    for (int i = 0; i < sz; i++) {
      tmp = p[t][i];
      C[tmp] = 0;
    }
    on[t] = 0;
    puts("Success");
  }
}
int main() {
  char c;
  int t;
  while (cin >> n >> m) {
    init();
    memset(on, 0, sizeof(on));
    memset(C, 0, sizeof(C));
    for (int i = 1; i <= m; i++) {
      cin >> c >> t;
      work(c, t);
    }
  }
}
