#include <bits/stdc++.h>
using namespace std;
std::map<int, set<int> > V;
void push(int d) {
  int olD = d;
  for (int i = 2; i * i <= d; ++i) {
    while (d % i == 0) {
      V[i].insert(olD);
      d /= i;
    }
  }
  if (d != 1) V[d].insert(olD);
}
void rem(int d) {
  int olD = d;
  for (int i = 2; i * i <= d; ++i) {
    while (d % i == 0) {
      V[i].erase(olD);
      if (V[i].size() == 0) {
        V.erase(i);
      }
      d /= i;
    }
  }
  if (d != 1) {
    V[d].erase(olD);
    if (V[d].size() == 0) V.erase(d);
  }
}
int main(int argc, char **argv) {
  int n, m;
  cin >> n >> m;
  char c;
  int d;
  set<int> on;
  for (int i = 0; i < m; ++i) {
    cin >> c >> d;
    if (c == '+' && on.count(d) == 1) {
      printf("Already on\n");
    } else if (c == '-' && on.count(d) == 0) {
      printf("Already off\n");
    } else if (c == '+') {
      int dd = d;
      for (int i = 2; i * i <= d; ++i) {
        while (d % i == 0) {
          if (V.count(i)) {
            printf("Conflict with %d\n", *V[i].begin());
            goto end;
          }
          d /= i;
        }
      }
      if (V.count(d)) {
        printf("Conflict with %d\n", *V[d].begin());
        goto end;
      }
      printf("Success\n");
      push(dd);
      on.insert(dd);
    end:;
    } else if (c == '-') {
      printf("Success\n");
      rem(d);
      on.erase(d);
    }
  }
  return 0;
}
