#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
bool prm[N], st[N];
int hsh[N];
vector<int> lst;
vector<int> g[N];
int main() {
  int i, j, k, n, m;
  scanf("%d", &n);
  memset(prm, true, sizeof(prm));
  lst.push_back(2);
  for (i = 4; i <= 400; i += 2) prm[i] = false;
  for (i = 3; i <= 400; i += 2)
    if (prm[i]) {
      lst.push_back(i);
      for (j = i * i; j <= 400; j += i) prm[j] = false;
    }
  int num = (int)lst.size();
  for (i = 2; i <= n; i++) {
    k = i;
    for (j = 0; j < num; j++)
      if (k % lst[j] == 0) {
        g[i].push_back(lst[j]);
        while (k % lst[j] == 0) k /= lst[j];
      }
    if (k != 1) g[i].push_back(k);
  }
  for (scanf("%d", &m); m; m--) {
    getchar();
    char ch;
    scanf("%c%d", &ch, &i);
    if (ch == '+') {
      if (st[i])
        puts("Already on");
      else {
        if (i == 1) {
          puts("Success");
          st[i] = true;
        } else {
          k = g[i].size();
          for (j = 0; j < k; j++)
            if (hsh[g[i][j]]) {
              printf("Conflict with %d\n", hsh[g[i][j]]);
              break;
            }
          if (j == k) {
            puts("Success");
            st[i] = true;
            for (j = 0; j < k; j++) hsh[g[i][j]] = i;
          }
        }
      }
    } else {
      if (!st[i])
        puts("Already off");
      else {
        st[i] = false;
        puts("Success");
        if (i != 1) {
          k = g[i].size();
          for (j = 0; j < k; j++) hsh[g[i][j]] = 0;
        }
      }
    }
  }
  return 0;
}
