#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
bool vis[N];
vector<int> p[N];
set<int> s[N];
void init(int n) {
  for (int i = 2; i <= n; i++)
    if (!vis[i]) {
      for (int j = i; j <= n; j += i) {
        p[j].push_back(i);
        vis[j] = true;
      }
    }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  init(n);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= m; i++) {
    char op[2];
    int x;
    scanf("%s%d", op, &x);
    if (op[0] == '+') {
      if (vis[x])
        printf("Already on\n");
      else {
        int y = -1;
        for (int j = 0; j < (int)p[x].size(); j++)
          if (s[p[x][j]].size()) {
            y = *s[p[x][j]].begin();
            break;
          }
        if (y != -1) {
          printf("Conflict with %d\n", y);
        } else {
          for (int j = 0; j < (int)p[x].size(); j++) s[p[x][j]].insert(x);
          printf("Success\n");
          vis[x] = true;
        }
      }
    } else {
      if (!vis[x])
        printf("Already off\n");
      else {
        for (int j = 0; j < (int)p[x].size(); j++) s[p[x][j]].erase(x);
        printf("Success\n");
        vis[x] = false;
      }
    }
  }
  return 0;
}
