#include <bits/stdc++.h>
using namespace std;
int factors[100005];
bool P[1000], ON[100005];
vector<int> primes;
int main() {
  int p = 0;
  P[0] = 1;
  P[1] = 1;
  for (int i = 2; i < 1000; i++) {
    for (int j = i + i; j < 1000; j += i) {
      P[j] = 1;
    }
  }
  for (int i = 0; i < 1000; i++) {
    if (!P[i]) {
      primes.push_back(i);
      p++;
    }
  }
  int N, M;
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    char c[5];
    int ind, oind;
    scanf("%s %d", c, &ind);
    oind = ind;
    if (c[0] == '+') {
      if (ON[oind])
        printf("Already on\n");
      else {
        vector<int> F;
        bool O = 0;
        for (int j = 0; j < p; j++) {
          bool f = 0;
          while (ind % primes[j] == 0) {
            ind /= primes[j];
            f = 1;
          }
          if (f) {
            if (factors[primes[j]]) {
              printf("Conflict with %d\n", factors[primes[j]]);
              O = 1;
              break;
            } else
              F.push_back(primes[j]);
          }
        }
        if (!O) {
          if (ind != 1) {
            if (factors[ind]) {
              printf("Conflict with %d\n", factors[ind]);
              O = 1;
            } else
              F.push_back(ind);
          }
          if (!O) {
            for (int j = 0; j < (int)F.size(); j++) factors[F[j]] = oind;
            printf("Success\n");
            ON[oind] = 1;
          }
        }
      }
    } else {
      if (!ON[oind])
        printf("Already off\n");
      else {
        for (int j = 0; j < p; j++) {
          bool f = 0;
          while (ind % primes[j] == 0) {
            ind /= primes[j];
            f = 1;
          }
          if (f) factors[primes[j]] = 0;
        }
        if (ind != 1) factors[ind] = 0;
        printf("Success\n");
        ON[oind] = 0;
      }
    }
  }
}
