#include <bits/stdc++.h>
using namespace std;
int p[100009], lp[100009];
int on[100009], vis[100009];
int n, m;
void init() {
  memset(lp, 0, sizeof(lp));
  memset(on, 0, sizeof(on));
  memset(vis, 0, sizeof(vis));
}
int check(int a) {
  while (a > 1) {
    if (vis[lp[a]]) return vis[lp[a]];
    a /= lp[a];
  }
  return 0;
}
void insert(int a) {
  on[a] = 1;
  int tmp = a;
  while (a > 1) {
    vis[lp[a]] = tmp;
    a /= lp[a];
  }
}
void remove(int a) {
  on[a] = 0;
  while (a > 1) {
    vis[lp[a]] = 0;
    a /= lp[a];
  }
}
int main() {
  cin >> n >> m;
  p[1] = 1;
  init();
  for (long long i = 2; i <= n; i++) {
    if (lp[i] == 0) lp[i] = i;
    for (long long j = i * i; j <= n; j += i)
      if (lp[j] == 0) lp[j] = i;
  }
  for (int i = 0; i < m; i++) {
    char c;
    int a;
    scanf(" %c %d", &c, &a);
    if (c == '+') {
      if (on[a])
        puts("Already on");
      else {
        int tmp = check(a);
        if (tmp)
          printf("Conflict with %d\n", tmp);
        else {
          puts("Success");
          insert(a);
        }
      }
    } else {
      if (!on[a])
        puts("Already off");
      else {
        puts("Success");
        remove(a);
      }
    }
  }
  return 0;
}
