#include <bits/stdc++.h>   using namespace std;   char ch[100001];   int per[100001];   bool is[100001];   bool vis[100001];   bool mem[100001];   bool have[100001];   vector<int> V;   int main() {     int i, j;     int a, b;     int n, m;     cin >> n >> m;     for (i = 0; i < m; i++) {       cin >> ch[i] >> per[i];       have[per[i]] = true;     }     V.clear();     memset(is, true, sizeof is);     for (i = 0; i < m; i++) {       if (ch[i] ==  + ) {         if (!vis[per[i]] && i) is[per[i]] = false;         if (V.size()) {           is[per[i]] = false;         } else {           for (j = i - 1; j >= 0; j--) {             if (per[i] != per[j]) is[per[j]] = false;             if (mem[j]) break;           }           mem[i - 1] = true;         }         V.push_back(per[i]);       } else {         if (!vis[per[i]]) {           for (j = i - 1; j >= 0; j--) {             is[per[j]] = false;             if (mem[j]) break;           }           mem[i - 1] = true;           if (V.size()) is[per[i]] = false;         } else if (V.size() == 1) {           if (V[0] == per[i])             V.clear();           else {             int num = per[i];             V.erase(std::remove(V.begin(), V.end(), num), V.end());             is[num] = false;           }         } else if (V.size()) {           int num = per[i];           V.erase(std::remove(V.begin(), V.end(), num), V.end());           is[num] = false;         }       }       if (!vis[per[i]]) vis[per[i]] = true;     }     vector<int> res;     res.clear();     for (i = 1; i <= n; i++) {       if (!have[i]) {         res.push_back(i);       } else {         if (is[i]) res.push_back(i);       }     }     int sz = res.size();     cout << sz << endl;     for (i = 0; i < sz; i++) cout << res[i] <<    ;     return 0;   }   