#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int n, m;
int con[MAXN];
bool tag[MAXN];
int check(int x) {
  for (int i = 2; i * i <= x; i++) {
    if ((x % i == 0) && (con[i])) return con[i];
    while (x % i == 0) x /= i;
  }
  if ((x > 1) && (con[x])) return con[x];
  return 0;
}
void turnOn(int x) {
  tag[x] = true;
  int t = x;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) con[i] = t;
    while (x % i == 0) x /= i;
  }
  if (x > 1) con[x] = t;
}
void turnOff(int x) {
  tag[x] = false;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) con[i] = 0;
    while (x % i == 0) x /= i;
  }
  if (x > 1) con[x] = 0;
}
int main() {
  scanf("%d %d\n", &n, &m);
  memset(tag, false, sizeof(false));
  for (int i = 0; i < m; i++) {
    char c;
    int x;
    scanf("%c %d\n", &c, &x);
    if (c == '+') {
      if (tag[x])
        printf("Already on\n");
      else {
        int y = check(x);
        if (!y) {
          turnOn(x);
          printf("Success\n");
        } else
          printf("Conflict with %d\n", y);
      }
    } else {
      if (!tag[x])
        printf("Already off\n");
      else {
        turnOff(x);
        printf("Success\n");
      }
    }
  }
  return 0;
}
