#include <bits/stdc++.h>
using namespace std;
int p[100010];
bool vis[100010];
set<int> f[100010];
void init() {
  p[1] = 1;
  for (int i = 2; i <= 100000; i++) {
    if (!p[i]) {
      for (int j = i * 2; j <= 100000; j += i) p[j] = i;
    }
  }
  for (int i = 2; i <= 100000; i++)
    if (!p[i]) p[i] = i;
}
int main() {
  init();
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    memset(vis, 0, sizeof(vis));
    char str[10];
    int x, cf;
    for (int t = 0; t < m; t++) {
      cf = 0;
      scanf("%s%d", str, &x);
      if (str[0] == '+') {
        if (vis[x]) {
          printf("Already on\n");
          continue;
        }
        for (int k = x; k != 1; k = k / p[k]) {
          if (f[p[k]].size() > 0) {
            cf = *f[p[k]].begin();
            break;
          }
        }
        if (cf)
          printf("Conflict with %d\n", cf);
        else {
          printf("Success\n");
          for (int k = x; k != 1; k = k / p[k]) {
            f[p[k]].insert(x);
          }
          vis[x] = true;
        }
      } else {
        if (!vis[x]) {
          printf("Already off\n");
        } else {
          printf("Success\n");
          for (int k = x; k != 1; k = k / p[k]) {
            f[p[k]].erase(x);
          }
          vis[x] = false;
        }
      }
    }
  }
  return 0;
}
