#include <bits/stdc++.h>
using namespace std;
int n, m;
int np[110000];
int pr[110000][20];
int v[110000];
int on[110000];
int main() {
  int i, j;
  while (scanf("%d", &n) == 1) {
    for (i = 1; i <= n; i++) {
      np[i] = 0;
      int nw = i;
      for (j = 2; j <= (int)sqrt((double)i); j++) {
        if (nw % j == 0) {
          pr[i][np[i]++] = j;
          while (nw % j == 0) nw = nw / j;
        }
      }
      if (nw != 1) {
        pr[i][np[i]++] = nw;
      }
    }
    memset(v, -1, sizeof(v));
    memset(on, 0, sizeof(on));
    scanf("%d", &m);
    while (m--) {
      char op;
      int cr;
      scanf("%s", &op);
      scanf("%d", &cr);
      if (op == '+') {
        if (on[cr] == 1)
          printf("Already on\n");
        else {
          int fd = 0;
          for (i = 0; i < np[cr]; i++) {
            if (v[pr[cr][i]] >= 0) {
              fd = 1;
              break;
            }
          }
          if (fd == 1)
            printf("Conflict with %d\n", v[pr[cr][i]]);
          else {
            printf("Success\n");
            for (j = 0; j < np[cr]; j++) v[pr[cr][j]] = cr;
            on[cr] = 1;
          }
        }
      } else {
        if (on[cr] == 0)
          printf("Already off\n");
        else {
          for (i = 0; i < np[cr]; i++) v[pr[cr][i]] = -1;
          printf("Success\n");
          on[cr] = 0;
        }
      }
    }
  }
}
