#include <bits/stdc++.h>
int a[100010];
int s[100010];
int u[100010];
char str[10];
int main() {
  int n, m, i, j, x, y, xx;
  for (i = 2; i < 100010; i++) {
    if (a[i] == 0) {
      a[i] = i;
      if (i < 1000) {
        for (j = i * i; j < 100010; j += i) {
          a[j] = i;
        }
      }
    }
  }
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) u[i] = 0;
  while (m--) {
    scanf("%s%d", str, &x);
    if (str[0] == '+') {
      if (u[x]) {
        printf("Already on\n");
      } else {
        xx = x;
        while (x > 1) {
          y = a[x];
          if (s[y]) break;
          while (x % y == 0) x /= y;
        }
        if (x > 1) {
          printf("Conflict with %d\n", s[y]);
        } else {
          printf("Success\n");
          x = xx;
          while (x > 1) {
            y = a[x];
            s[y] = xx;
            while (x % y == 0) x /= y;
          }
          u[xx] = 1;
        }
      }
    } else {
      if (!u[x]) {
        printf("Already off\n");
      } else {
        printf("Success\n");
        u[x] = 0;
        while (x > 1) {
          y = a[x];
          s[y] = 0;
          while (x % y == 0) x /= y;
        }
      }
    }
  }
  return 0;
}
