#include <bits/stdc++.h>
using namespace std;
bool p[100001], have[100001];
vector<int> fac[100001];
int H[100001];
int main() {
  int i, j, k, n, m;
  scanf("%d%d", &n, &m);
  for (i = 2; i < 100001; i++)
    if (!p[i]) {
      fac[i].push_back(i);
      for (j = i + i; j < 100001; j += i) {
        p[j] = 1;
        fac[j].push_back(i);
      }
    }
  while (m--) {
    char c[4];
    int x;
    scanf("%s%d", c, &x);
    if (c[0] == '+') {
      if (have[x])
        puts("Already on");
      else {
        for (i = 0; i < fac[x].size(); i++) {
          if (H[fac[x][i]]) {
            printf("Conflict with %d\n", H[fac[x][i]]);
            break;
          }
        }
        if (i == fac[x].size()) {
          printf("Success\n");
          for (i = 0; i < fac[x].size(); i++) H[fac[x][i]] = x;
          have[x] = 1;
        }
      }
    } else {
      if (!have[x])
        puts("Already off");
      else {
        puts("Success");
        have[x] = 0;
        for (i = 0; i < fac[x].size(); i++) H[fac[x][i]] = 0;
      }
    }
  }
  return 0;
}
