#include <bits/stdc++.h>
using namespace std;
int n, m, x, q[100100];
char t;
vector<int> d;
bool used[100100];
void calc(int x) {
  d.resize(0);
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) {
      while (x % i == 0) x /= i;
      d.push_back(i);
    }
  if (x != 1) d.push_back(x);
}
int main() {
  scanf("%d%d\n", &n, &m);
  memset((used), (false), sizeof((used)));
  memset((q), (0), sizeof((q)));
  for (int i = 0; i < (m); i++) {
    while (t = getchar(), t != '+' && t != '-')
      ;
    scanf("%d", &x);
    if (t == '+') {
      if (used[x]) {
        puts("Already on");
        continue;
      }
      calc(x);
      bool ok = true;
      for (int j = 0; j < (d.size()); j++)
        if (q[d[j]]) {
          printf("Conflict with %d\n", q[d[j]]);
          ok = false;
          break;
        }
      if (ok) {
        for (int j = 0; j < (d.size()); j++) q[d[j]] = x;
        used[x] = true;
        puts("Success");
      }
    } else {
      if (!used[x]) {
        puts("Already off");
        continue;
      }
      used[x] = false;
      calc(x);
      for (int j = 0; j < (d.size()); j++) q[d[j]] = 0;
      puts("Success");
    }
  }
}
