#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     vector<int> prime(n + 1, 0);     vector<int> div(n + 1, 0);     prime[1] = 1;     for (long long i = 2; i <= n; i++) {       if (!prime[i]) {         for (long long j = i; j <= n; j += i) {           prime[j] = i;         }       }     }     for (int i = 0; i < m; i++) {       int flag;       int x;       char c;       cin >> c >> x;       if (c ==  + ) {         if (div[prime[x]] == x) {           cout <<  Already on  << endl;         } else {           flag = 0;           for (long long i = x; i > 1; i /= prime[i]) {             if (div[prime[i]]) {               flag = div[prime[i]];             }           }           if (flag) {             cout <<  Conflict with   << flag << endl;           } else {             for (long long i = x; i > 1; i /= prime[i]) {               div[prime[i]] = x;             }             if (x == 1) {               div[1] = 1;             }             cout <<  Success  << endl;           }         }       } else {         if (div[prime[x]] != x) {           cout <<  Already off  << endl;         } else {           for (long long i = x; i > 1; i /= prime[i]) {             div[prime[i]] = 0;           }           if (x == 1) {             div[1] = 0;           }           cout <<  Success  << endl;         }       }     }     return 0;   }   