#include <bits/stdc++.h>
using namespace std;
void sprint(string s) {
  for (int i = 0; i < s.size(); ++i) printf("%c", s[i]);
  printf("\n");
}
bool v[100001], on[100001];
int len, sp[100001];
void Sieve() {
  for (int i = 2; i < 100001; i += 2) sp[i] = 2;
  for (long long i = 3; i < 100001; i += 2) {
    if (!v[i]) {
      sp[i] = i;
      for (long long j = i; (j * i) < 100001; j += 2) {
        if (!v[j * i]) v[j * i] = true, sp[j * i] = i;
      }
    }
  }
}
int main() {
  int n, m;
  ios_base::sync_with_stdio(0);
  sp[3] = 3, sp[5] = 5, sp[7] = 7, sp[9] = 3, sp[11] = 11, sp[13] = 13,
  sp[15] = 3, sp[17] = 17, sp[19] = 19, sp[21] = 3, sp[23] = 23, sp[25] = 5,
  sp[27] = 3, sp[29] = 29;
  Sieve();
  cin >> n >> m;
  char x;
  int y;
  set<int> link[100001];
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    if (x == '+') {
      if (on[y]) {
        printf("Already on\n");
        continue;
      }
      set<int> temp;
      int f = y;
      while (f > 1) {
        temp.insert(sp[f]);
        f = f / sp[f];
      }
      bool check = 0;
      for (auto it = temp.begin(); it != temp.end(); ++it) {
        set<int> r = link[*it];
        if (r.size() != 0) {
          printf("Conflict with %d\n", *(r.begin()));
          check = 1;
          break;
        }
      }
      if (check) continue;
      for (auto it = temp.begin(); it != temp.end(); ++it) {
        link[*it].insert(y);
      }
      printf("Success\n");
      on[y] = 1;
    } else {
      if (!on[y]) {
        printf("Already off\n");
        continue;
      }
      set<int> temp;
      int f = y;
      while (f > 1) {
        temp.insert(sp[f]);
        f = f / sp[f];
      }
      for (auto it = temp.begin(); it != temp.end(); ++it) {
        link[*it].erase(y);
      }
      printf("Success\n");
      on[y] = 0;
    }
  }
  return 0;
}
