#include <bits/stdc++.h>
using namespace std;
vector<int> primes;
int b[200000], link[200000];
int n, m;
int used[200000];
set<int> d[20000];
vector<int> proc(int a) {
  vector<int> res;
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) {
      res.push_back(i);
      while (a % i == 0) {
        a /= i;
      }
    }
  }
  if (a != 1) res.push_back(a);
  return res;
}
string det(int a) {
  string t;
  while (a) {
    t.push_back(a % 10 + '0');
    a /= 10;
  }
  reverse(t.begin(), t.end());
  return t;
}
string solve(char c, int t) {
  if (c == '+') {
    if (used[t]) {
      return "Already on";
    }
    vector<int> a = proc(t);
    for (int j = 0; j < a.size(); j++) {
      int w = link[a[j]];
      if (d[w].size()) {
        int y = *(d[w].begin());
        return "Conflict with " + det(y);
      }
    }
    for (int j = 0; j < a.size(); j++) {
      int w = link[a[j]];
      d[w].insert(t);
    }
    used[t] = 1;
    return "Success";
  } else {
    if (!used[t]) {
      return "Already off";
    }
    vector<int> a = proc(t);
    for (int j = 0; j < a.size(); j++) {
      int w = link[a[j]];
      d[w].erase(t);
    }
    used[t] = 0;
    return "Success";
  }
}
int main() {
  for (int i = 2; i < 200000; i++) {
    if (!b[i]) {
      link[i] = primes.size();
      primes.push_back(i);
      for (int j = i + i; j < 200000; j += i) {
        b[j] = 1;
      }
    }
  }
  scanf("%d%d\n", &n, &m);
  char c;
  int t;
  for (int i = 0; i < m; i++) {
    scanf("%c%d\n", &c, &t);
    cout << solve(c, t) << endl;
  }
  return 0;
}
