#include <bits/stdc++.h>
using namespace std;
bool on_off[100010];
int n, m;
int store[100010];
int refl[100010];
int check(int x) {
  if (x == 1) {
    refl[1] = 1;
    return 0;
  }
  int cnt = 0, save = x;
  int lim = sqrt(x + 0.5);
  for (int i = 2; i <= lim; i++) {
    if (x < i) break;
    if (x % i == 0) {
      store[cnt++] = i;
      while (x % i == 0) x /= i;
    }
  }
  if (x > 1) store[cnt++] = x;
  for (int i = 0; i < cnt; i++) {
    if (refl[store[i]]) return refl[store[i]];
  }
  for (int i = 0; i < cnt; i++) refl[store[i]] = save;
  return 0;
}
void cancel(int x) {
  if (x == 1) {
    refl[1] = 0;
    return;
  }
  int lim = sqrt(x + 0.5);
  for (int i = 2; i <= lim; i++) {
    if (x < i) break;
    if (x % i == 0) {
      refl[i] = 0;
      while (x % i == 0) x /= i;
    }
  }
  if (x > 1) refl[x] = 0;
}
int main() {
  memset(refl, 0, sizeof(refl));
  memset(on_off, 0, sizeof(on_off));
  scanf("%d%d", &n, &m);
  char oper;
  int ob;
  for (int i = 0; i < m; i++) {
    scanf(" %c %d", &oper, &ob);
    if (oper == '-') {
      if (on_off[ob]) {
        on_off[ob] = 0;
        cancel(ob);
        printf("Success\n");
      } else {
        printf("Already off\n");
      }
    } else {
      if (on_off[ob]) {
        printf("Already on\n");
      } else {
        int x = check(ob);
        if (x) {
          printf("Conflict with %d\n", x);
        } else {
          on_off[ob] = 1;
          printf("Success\n");
        }
      }
    }
  }
  return 0;
}
