#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
bool mark[N];
int jud[N];
int prime[N];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 2; i <= n; i++) {
    if (prime[i] == 0) {
      for (int j = i; j < N; j += i) prime[j] = i;
    }
  }
  char str[4];
  int x;
  while (m--) {
    scanf("%s%d", str, &x);
    if (str[0] == '+') {
      if (mark[x]) {
        printf("Already on\n");
        continue;
      }
      int t;
      int T = 0;
      for (t = x; t > 1; t /= prime[t]) {
        if (jud[prime[t]]) {
          printf("Conflict with %d\n", jud[prime[t]]);
          T = 1;
          break;
        }
      }
      if (T) continue;
      mark[x] = 1;
      for (t = x; t > 1; t /= prime[t]) {
        jud[prime[t]] = x;
      }
      printf("Success\n");
    }
    if (str[0] == '-') {
      if (mark[x] == 0) {
        printf("Already off\n");
        continue;
      }
      mark[x] = 0;
      for (int t = x; t > 1; t /= prime[t]) jud[prime[t]] = 0;
      printf("Success\n");
    }
  }
  return 0;
}
