#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n;
    cin >> n;
    vi a(n+1);
    rep1(i, n) cin >> a[i];
    vi b(n+1);
    rep1r(i, n) {
        int sum = 0;
        for (int j=i*2; j<=n; j+=i) sum ^= b[j];
        b[i] = sum ^ a[i];
    }
    vi ans;
    rep1(i, n) if (b[i] == 1) ans.pb(i);
    int m = sz(ans);
    cout << m << endl;
    rep(i, m) printf("%d%c", ans[i], (i<m-1?' ':'\n'));
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1E5;
bool isSheep[MAXN];
bool o[MAXN];
bool options[2] = {true, false};

bool isValid(int n)
{
    bool firstSheep = isSheep[0];
    for (int i = 1; i < n; i++)
    {
         if (isSheep[i] && o[i] || !isSheep[i] && !o[i])
         {
             isSheep[(i + 1) % n] = isSheep[i - 1];
         }
         else if (isSheep[i] && !o[i] || !isSheep[i] && o[i])
         {
             isSheep[(i + 1) % n] = !isSheep[i - 1];
         }
    }
    if (isSheep[0] != firstSheep)
        return false;
    if (firstSheep && o[0] || !firstSheep && !o[0])
    {
        return isSheep[n - 1] == isSheep[1];
    }
    else
    {
        return isSheep[n - 1] != isSheep[1];
    }
}

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        char c;
        cin >> c;
        o[i] = c == 'o';
    }
    bool valid = false;
    for (bool s1 : options)
    {
        for (bool s2 : options)
        {
            isSheep[0] = s1;
            isSheep[1] = s2;
            if (isValid(n))
            {
                valid = true;
                break;
            }
        }
        if (valid)
            break;
    }
    if (valid)
    {
        stringstream ss;
        for (int i = 0; i < n; i++)
        {
            if (isSheep[i])
                ss << "S";
            else
                ss << "W";
        }
        cout << ss.str() << endl;
    }
    else
        cout << -1 << endl;
    return 0;
}
