#include <bits/stdc++.h>
int a, b, c[100005][320], l[100005], eb, n[100005];
char ea;
bool t[100005], p[320];
int main() {
  for (int i = 2; i < 320; i++) {
    if (p[i]) continue;
    for (int j = 1; i * j < 100005; j++) {
      c[i * j][l[i * j]++] = i;
      if (i * j < 320) p[i * j] = true;
    }
  }
  for (int i = 2; i < 100005; i++) {
    int k = i;
    for (int j = 0; j < l[i]; j++)
      while (k % c[i][j] == 0) k /= c[i][j];
    if (k != 1) c[i][l[i]++] = k;
  }
  scanf("%d %d\n", &a, &b);
  for (int i = 0; i < b; i++) {
    scanf("%c %d\n", &ea, &eb);
    if (ea == '-') {
      if (t[eb]) {
        printf("Success\n");
        t[eb] = false;
        for (int j = 0; j < l[eb]; j++) n[c[eb][j]] = 0;
      } else
        printf("Already off\n");
    } else if (t[eb])
      printf("Already on\n");
    else {
      bool ec = true;
      for (int j = 0; j < l[eb] && ec; j++) {
        if (n[c[eb][j]]) {
          ec = false;
          printf("Conflict with %d\n", n[c[eb][j]]);
        }
      }
      if (ec) {
        for (int j = 0; j < l[eb]; j++) n[c[eb][j]] = eb;
        t[eb] = true;
        printf("Success\n");
      }
    }
  }
  scanf("\n");
  return 0;
}
