#include <bits/stdc++.h>
using namespace std;
int N, M;
int T[100010] = {};
char enable[100010] = {};
int p[100010] = {};
void prime();
void del(int X);
int get(int X);
void add(int X);
int main() {
  cin >> N >> M;
  prime();
  for (int i = (int)0; i <= (int)M - 1; ++i) {
    char q;
    int X;
    cin >> q;
    scanf("%d", &X);
    if (q == '+') {
      int res = get(X);
      if (enable[X])
        puts("Already on");
      else if (res)
        printf("Conflict with %d\n", res);
      else {
        enable[X] = true;
        add(X);
        puts("Success");
      }
    } else {
      if (enable[X]) {
        enable[X] = false;
        del(X);
        puts("Success");
      } else
        puts("Already off");
    }
  }
}
void prime() {
  p[0] = p[1] = -1;
  for (int i = 2; i < 100010; ++i)
    if (!p[i]) {
      if (i * 1ll * i < 100010)
        for (int j = i * i; j < 100010; j += i) p[j] = i;
      else
        break;
    }
}
void del(int X) {
  while (p[X] > 1 || X > 1) {
    int d = p[X] ? p[X] : X;
    T[d] = 0;
    X /= d;
  }
}
void add(int X) {
  int N = X;
  while (p[X] > 1 || X > 1) {
    int d = p[X] ? p[X] : X;
    T[d] = N;
    X /= d;
  }
}
int get(int X) {
  while (p[X] > 1 || X > 1) {
    int d = p[X] ? p[X] : X;
    if (T[d]) return T[d];
    X /= d;
  }
  return 0;
}
