#include <bits/stdc++.h>
using namespace std;
set<int> s[100003];
vector<int> b;
bool a[100003], p;
int n, m, i, j, k, k0;
char x;
int main() {
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; ++i) {
    p = false;
    cin >> x >> k;
    if (k == 1) {
    }
    if (x == '+') {
      if (a[k]) {
        printf("Already on\n");
        continue;
      }
      j = 2;
      k0 = k;
      while (j * j <= k0) {
        if (k % j == 0) {
          k /= j;
          b.push_back(j);
          if (s[j].size() > 0) {
            printf("Conflict with %d\n", (*s[j].begin()));
            p = true;
            break;
          }
          while (k % j == 0) k /= j;
        } else
          ++j;
      }
      if (p) {
        b.clear();
        continue;
      }
      if (k != 1) {
        j = k;
        b.push_back(j);
        if (s[j].size() > 0) {
          printf("Conflict with %d\n", (*s[j].begin()));
          p = true;
          b.clear();
          continue;
        }
      }
      if (!p) {
        a[k0] = true;
        printf("Success\n");
        for (j = 0; j < b.size(); ++j) s[b[j]].insert(k0);
      }
      b.clear();
    } else {
      if (!a[k]) {
        printf("Already off\n");
        continue;
      }
      a[k] = false;
      k0 = k;
      j = 2;
      while (j * j <= k0) {
        if (k % j == 0) {
          k /= j;
          s[j].erase(k0);
          while (k % j == 0) k /= j;
        }
        ++j;
      }
      if (k > 1) s[k].erase(k0);
      printf("Success\n");
    }
  }
  return 0;
}
