#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
map<int, int>::iterator it;
vector<int> V;
bool Present[100005];
int SPF[100005];
void Seive() {
  int i, j;
  for (i = 2; i <= 100000; ++i) {
    if (SPF[i] != 0) continue;
    SPF[i] = i;
    j = i + i;
    while (j <= 100000) {
      if (SPF[j] == 0) SPF[j] = i;
      j += i;
    }
  }
}
void PrimeFactorization(int Num) {
  int x, y;
  y = SPF[Num];
  while (Num > 1) {
    x = SPF[Num];
    if (x != y) {
      V.emplace_back(y);
      y = x;
    }
    Num /= x;
  }
  V.emplace_back(y);
}
void Remove(int Num) {
  for (int i = 0; i < V.size(); ++i) {
    M.erase(V[i]);
  }
}
int Add(int Num) {
  for (int i = 0; i < V.size(); ++i) {
    it = M.find(V[i]);
    if (it != M.end()) return it->second;
  }
  for (int i = 0; i < V.size(); ++i) {
    M[V[i]] = Num;
  }
  return -1;
}
int main() {
  int N, m, i, Num;
  scanf("%d%d", &N, &m);
  Seive();
  char ch;
  int res;
  for (i = 1; i <= m; ++i) {
    scanf("%c", &ch);
    while (ch != '+' && ch != '-') scanf("%c", &ch);
    scanf("%d", &Num);
    if (ch == '+' && Present[Num] == true) {
      printf("Already on\n");
      continue;
    } else if (ch == '-' && Present[Num] == false) {
      printf("Already off\n");
      continue;
    }
    if (Num == 1) {
      if (ch == '+')
        Present[Num] = true;
      else
        Present[Num] = false;
      printf("Success\n");
      continue;
    }
    PrimeFactorization(Num);
    if (ch == '-') {
      Remove(Num);
      Present[Num] = false;
      printf("Success\n");
    } else {
      res = Add(Num);
      if (res == -1) {
        printf("Success\n");
        Present[Num] = true;
      } else
        printf("Conflict with %d\n", res);
    }
    V.clear();
  }
  return 0;
}
