#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
long long power(long long x, long long y, long long m = 1000000000000000007) {
  if (!y) return 1;
  if (y % 2) return x * power(x, y - 1, m) % m;
  long long k = power(x, y / 2, m);
  return k * k % m;
}
vector<vector<long long> > multy(vector<vector<long long> > x,
                                 vector<vector<long long> > y,
                                 long long m = 1000000000000000007) {
  vector<vector<long long> > z;
  z.resize(x.size());
  for (int i = 0; i < z.size(); ++i) z[i].assign(y[0].size(), 0);
  for (int k = 0; k < y.size(); ++k)
    for (int i = 0; i < x.size(); ++i)
      for (int j = 0; j < y[0].size(); ++j)
        z[i][j] = (z[i][j] + x[i][k] * y[k][j]) % m;
  return z;
}
vector<vector<long long> > power(vector<vector<long long> > x, long long y,
                                 long long m = 1000000000000000007) {
  if (y == 1) return x;
  if (y % 2) return multy(x, power(x, y - 1, m), m);
  vector<vector<long long> > k = power(x, y / 2, m);
  return multy(k, k, m);
}
long double power(long double x, long long y) {
  return exp(log(x) * (long double)y);
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long gcdex(long long a, long long b, long long& x, long long& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long d = gcdex(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
long long lcm(long long x, long long y, long long m = 1000000000000000007) {
  return x / gcd(x, y) * y % m;
}
long long phi(long long n) {
  long long result = n;
  for (long long i = 2; i * i <= n; ++i)
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      result -= result / i;
    }
  if (n > 1) result -= result / n;
  return result;
}
long long rev_el(long long a, long long m) {
  long long x, y;
  long long g = gcdex(a, m, x, y);
  if (g != 1)
    return power(x, phi(m) - 1, m);
  else {
    x = (x % m + m) % m;
    return x;
  }
}
bool isPrime(long long x) {
  if (x <= 1) return false;
  for (long long i = 2; i * i <= x; ++i)
    if (x % i == 0) return false;
  return true;
}
int cnt_dig(long long x) {
  if (!x) return 1;
  int ans = 0;
  while (x) {
    x /= 10;
    ans++;
  }
  return ans;
}
int sum_dig(long long x) {
  long long ans = 0;
  while (x) {
    ans += x % 10;
    x /= 10;
  }
  return ans;
}
int n, m;
int u[200000];
set<long long> conf[200000];
int main() {
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 0; i < m; ++i) {
      char c;
      long long d;
      scanf("\n%c %lld", &c, &d);
      if (c == '+') {
        if (u[d]) {
          puts("Already on");
          continue;
        }
        long long d1 = d;
        int ok = 0;
        for (long long j = 2; j * j <= d1; ++j)
          if (d1 % j == 0) {
            while (d1 % j == 0) d1 /= j;
            if (conf[j].size()) ok = j;
          }
        if (d1 > 1 && conf[d1].size()) ok = d1;
        if (ok) {
          printf("Conflict with %d\n", *conf[ok].begin());
        } else {
          puts("Success");
          u[d] = 1;
          long long d1 = d;
          for (long long j = 2; j * j <= d1; ++j)
            if (d1 % j == 0) {
              while (d1 % j == 0) d1 /= j;
              conf[j].insert(d);
            }
          if (d1 > 1) conf[d1].insert(d);
        }
      } else {
        if (!u[d]) {
          puts("Already off");
          continue;
        }
        u[d] = 0;
        long long d1 = d;
        for (long long j = 2; j * j <= d1; ++j)
          if (d1 % j == 0) {
            while (d1 % j == 0) d1 /= j;
            conf[j].erase(d);
          }
        if (d1 > 1) conf[d1].erase(d);
        puts("Success");
      }
    }
  }
}
