stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

#define maxn 2000000

#define infly 1<<30

using namespace std;



int a[maxn+5],h;

char s[100];



void maxheapfy(int i)

{

    int l=i*2;

    int r=i*2+1;

    int large;

    if(l<=h && a[l]>a[i])

        large=l;

    else large=i;

    if(r<=h && a[r]>a[large])

        large=r;



    if(large!=i)

    {

         swap(a[i],a[large]);

         maxheapfy(large);

    }



}



void heapinsert(int i,int k)

{

    if(k<a[i]) return;

    a[i]=k;

    while(i>1 && a[i/2]<a[i])

    {

        swap(a[i],a[i/2]);

        i/=2;

    }

}



void insert(int k)

{

    a[++h]=-infly;

    heapinsert(h,k);

}



int extract()

{

    if(h<1) return -infly;

    int maxv=a[1];

    swap(a[h],a[1]);

    h--;

    maxheapfy(1);

    return maxv;

}



int main()

{

    int k;

    while(scanf("%s",s) && s[2]!='d')

    {

        if(s[0]=='i')

        {

            scanf("%d",&k);

            insert(k);

        }

        else if(s[0]=='e')

        {

            printf("%d\n",extract());

        }

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define N 2000005

#define INF 2000000010

int n = 0;

int a[N];

void swap(int *a, int *b){

    int t;

    t = *a;

    *a= *b;

    *b = t;

}

void maxHeapify(int i){

    int l = 2*i;

    int r = 2*i+1;

    int maxi = i;

    if(l <= n && a[l] > a[maxi]){

        maxi = l;

    }

    if(r <= n && a[r] > a[maxi]){

        maxi = r;

    }

    if(maxi != i){

        swap(&a[i], &a[maxi]);

        maxHeapify(maxi);

    }

}

void insert(int key){

    a[++n] = key;

    int temp = n;

    while(temp > 1 && a[temp/2] < key){

        swap(&a[temp], &a[temp/2]);

        temp /= 2;

    }

}

int extract(){

    if(n < 1) return 0;

    int res = a[1];

    a[1] = a[n--];

    maxHeapify(1);

    return res;

}

int main(){

    char s[10];

    int k;

    while(scanf("%s", s), strcmp(s, "end")){

        if(s[0] == 'i'){

            scanf("%d", &k);

            insert(k);

        }else if(s[0] == 'e'){

            int p = extract();

            printf("%d\n", p);

        }

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

#define maxn 2000000

#define infly 1<<30

using namespace std;



int a[maxn+5],h;

char s[100];



void maxheapfy(int i)

{

    int l=i*2;

    int r=i*2+1;

    int large;

    if(l<=h && a[l]>a[i])

        large=l;

    else large=i;

    if(r<=h && a[r]>a[large])

        large=r;



    if(large!=i)

    {

         swap(a[i],a[large]);

         maxheapfy(large);

    }



}



void heapinsert(int i,int k)

{

    if(k<a[i]) return;

    a[i]=k;

    while(i>1 && a[i/2]<a[i])

    {

        swap(a[i],a[i/2]);

        i/=2;

    }

}



void insert(int k)

{

    a[++h]=-infly;

    heapinsert(h,k);

}



int extract()

{

    int maxv=a[1];

    swap(a[h],a[1]);

    h--;

    maxheapfy(1);

    return maxv;

}



int main()

{

    int k;

    while(scanf("%s",s) && s[2]!='d')

    {

        if(s[0]=='i')

        {

            scanf("%d",&k);

            insert(k);

        }

        else if(s[0]=='e')

        {

            printf("%d\n",extract());

        }

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define N 2000005

#define INF 2000000010

int n = 0;

int a[N];

void swap(int *a, int *b){

    int t;

    t = *a;

    *a= *b;

    *b = t;

}

void maxHeapify(int i){

    int l = 2*i;

    int r = 2*i+1;

    int maxi = i;

    if(l <= n && a[l] > a[maxi]){

        maxi = l;

    }

    if(r <= n && a[r] > a[maxi]){

        maxi = r;

    }

    if(maxi != i){

        swap(&a[i], &a[maxi]);

        maxHeapify(maxi);

    }

}

void insert(int key){

    a[++n] = key;

    int temp = n;

    while(temp > 1 && a[temp/2] < key){

        swap(&a[temp], &a[temp/2]);

        temp /= 2;

    }

}

int extract(){

    if(n < 1) return 0;

    int res = a[1];

    a[1] = a[n--];

    maxHeapify(1);

    return res;

}

int main(){

    char s[10];

    int k;

    while(scanf("%s", s), strcmp(s, "end")){

        if(s[0] == 'i'){

            scanf("%d", &k);

            insert(k);

        }else if(s[0] == 'e'){

            int p = extract();

            printf("%d\n", p);

        }

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define ll long long

int main() {

	ios_base::sync_with_stdio(0);

	

	priority_queue<ll> pq;

	string s;

	

	while(cin>>s && s!="end")

	{ 

		 ll x;



		if(s=="insert") 

		{		 cin>>x;

			

			pq.push(x);

	

			

		}

		else {

			x=pq.top();

			pq.pop();

			printf("%lld\n",x);

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define N 2000005

#define INF 2000000010

int n = 0;

int a[N];

void swap(int *a, int *b){

    int t;

    t = *a;

    *a= *b;

    *b = t;

}

void maxHeapify(int i){

    int l = 2*i;

    int r = 2*i+1;

    int maxi = i;

    if(l <= n && a[l] > a[maxi]){

        maxi = l;

    }

    if(r <= n && a[r] > a[maxi]){

        maxi = r;

    }

    if(maxi != i){

        swap(&a[i], &a[maxi]);

        maxHeapify(maxi);

    }

}

void insert(int key){

    a[++n] = key;

    int temp = n;

    while(temp > 1 && a[temp/2] < key){

        swap(&a[temp], &a[temp/2]);

        temp /= 2;

    }

}

int extract(){

    if(n < 1) return 0;

    int res = a[1];

    a[1] = a[n--];

    maxHeapify(1);

    return res;

}

int main(){

    char s[10];

    int k;

    while(scanf("%s", s), strcmp(s, "end")){

        if(s[0] == 'i'){

            scanf("%d", &k);

            insert(k);

        }else if(s[0] == 'e'){

            int p = extract();

            printf("%d\n", p);

        }

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    string s;

    int num;

    priority_queue<int> pq;

    while(cin>>s){

        if(s=="insert"){

            cin>>num;

            pq.push(num);

        }

        else if(s=="extract"){

            cout<<pq.top()<<'\n';

            pq.pop();

        }

        else{

            while(!pq.empty())

                pq.pop();

        }

    }

    return 0;

}




// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define N 2000005

#define INF 2000000010

int n = 0;

int a[N];

void swap(int *a, int *b){

    int t;

    t = *a;

    *a= *b;

    *b = t;

}

void maxHeapify(int i){

    int l = 2*i;

    int r = 2*i+1;

    int maxi = i;

    if(l <= n && a[l] > a[maxi]){

        maxi = l;

    }

    if(r <= n && a[r] > a[maxi]){

        maxi = r;

    }

    if(maxi != i){

        swap(&a[i], &a[maxi]);

        maxHeapify(maxi);

    }

}

void insert(int key){

    a[++n] = key;

    int temp = n;

    while(temp > 1 && a[temp/2] < key){

        swap(&a[temp], &a[temp/2]);

        temp /= 2;

    }

}

int extract(){

    if(n < 1) return 0;

    int res = a[1];

    a[1] = a[n--];

    maxHeapify(1);

    return res;

}

int main(){

    char s[10];

    int k;

    while(scanf("%s", s), strcmp(s, "end")){

        if(s[0] == 'i'){

            scanf("%d", &k);

            insert(k);

        }else if(s[0] == 'e'){

            int p = extract();

            printf("%d\n", p);

        }

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <algorithm>

#include <queue>

using namespace std;



int main()

{

    priority_queue<int> q;

    char op[20];

    int k;

    while (scanf("%s", op) != EOF&&op[2] != 'd') {

        if (op[0] == 'i') {

            scanf("%d", &k);

            q.push(k);

        }

        else {

            int k = q.top();

            q.pop();

            printf("%d\n", k);

        }

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define N 2000005

#define INF 2000000010

int n = 0;

int a[N];

void swap(int *a, int *b){

    int t;

    t = *a;

    *a= *b;

    *b = t;

}

void maxHeapify(int i){

    int l = 2*i;

    int r = 2*i+1;

    int maxi = i;

    if(l <= n && a[l] > a[maxi]){

        maxi = l;

    }

    if(r <= n && a[r] > a[maxi]){

        maxi = r;

    }

    if(maxi != i){

        swap(&a[i], &a[maxi]);

        maxHeapify(maxi);

    }

}

void insert(int key){

    a[++n] = key;

    int temp = n;

    while(temp > 1 && a[temp/2] < key){

        swap(&a[temp], &a[temp/2]);

        temp /= 2;

    }

}

int extract(){

    if(n < 1) return 0;

    int res = a[1];

    a[1] = a[n--];

    maxHeapify(1);

    return res;

}

int main(){

    char s[10];

    int k;

    while(scanf("%s", s), strcmp(s, "end")){

        if(s[0] == 'i'){

            scanf("%d", &k);

            insert(k);

        }else if(s[0] == 'e'){

            int p = extract();

            printf("%d\n", p);

        }

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



#define ms(a,x) memset(a,x,sizeof(a))

using namespace std;



#define N 200

#define MAX 2000000



typedef long long ll;



int main(){

	char com[20];

	priority_queue<int>PQ;

	

	while(1){

		scanf("%s",com);

		if(com[0]=='i'){

			int key;

			scanf("%d",&key);

			PQ.push(key);

		}

		else if(com[1]=='x'){

			cout<<PQ.top()<<endl;

			PQ.pop();

		}

		else if(com[0]=='e'){

			break;

		}

	}

	return 0;

}






// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define N 2000005

#define INF 2000000010

int n = 0;

int a[N];

void swap(int *a, int *b){

    int t;

    t = *a;

    *a= *b;

    *b = t;

}

void maxHeapify(int i){

    int l = 2*i;

    int r = 2*i+1;

    int maxi = i;

    if(l <= n && a[l] > a[maxi]){

        maxi = l;

    }

    if(r <= n && a[r] > a[maxi]){

        maxi = r;

    }

    if(maxi != i){

        swap(&a[i], &a[maxi]);

        maxHeapify(maxi);

    }

}

void insert(int key){

    a[++n] = key;

    int temp = n;

    while(temp > 1 && a[temp/2] < key){

        swap(&a[temp], &a[temp/2]);

        temp /= 2;

    }

}

int extract(){

    if(n < 1) return 0;

    int res = a[1];

    a[1] = a[n--];

    maxHeapify(1);

    return res;

}

int main(){

    char s[10];

    int k;

    while(scanf("%s", s), strcmp(s, "end")){

        if(s[0] == 'i'){

            scanf("%d", &k);

            insert(k);

        }else if(s[0] == 'e'){

            int p = extract();

            printf("%d\n", p);

        }

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <utility>

#include <vector>



using namespace std;



void max_heapify(vector<int>& H, int i, int size)

{

    int left = i * 2;

    int right = i * 2 + 1;



    int max = i;

    if (left <= size && H[max] < H[left])

        max = left;

    if (right <= size && H[max] < H[right])

        max = right;



    if (max != i) {

        swap(H[max], H[i]);

        max_heapify(H, max, size);

    }

}



void build_max_heap(vector<int>& H, int size)

{

    for (int i = size / 2; i > 0; --i)

        max_heapify(H, i, size);

}



void insert(vector<int>& S, int key, int& last)

{

    ++last;

    S[last] = key;



    int child = last;

    int parent = child / 2;

    while (parent > 0 && child > 0 && S[parent] < S[child]) {

        swap(S[parent], S[child]);

        child = parent;

        parent = child / 2;

    }

}



int extract_max(vector<int>& S, int& last)

{

    if (last < 1)   // priority queue is empty

        return -1;



    int max = S[1]; // first elem is max value



    S[1] = S[last];

    --last;

    max_heapify(S, 1, last);



    return max;

}



int main()

{

    const int max_instruction = 2000000;

    vector<int> S(max_instruction + 1);

    int last = 0;



    while (true) {

        string instruction;

        cin >> instruction;



        if (instruction == "end") {

            break;

        } else if (instruction == "extract") {

            int max = extract_max(S, last);

            cout << max << '\n';

        } else {

            int k;

            cin >> k;

            insert(S, k, last);

        }

    }

}




// Optimized solution to the same problem (faster):
#include <iostream>

#include <queue>

#include <string>



using namespace std;



int main() {

    priority_queue<long> pq;

    string inst;

    while (true) {

        cin >> inst;

        if (inst == "end") {

            break;

        } else if (inst == "insert") {

            long key;

            cin >> key;

            pq.push(key);

        } else {

            cout << pq.top() << '\n';

            pq.pop();

        }

    }

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <queue>

#include <cstdio>



using namespace std;



int main()

{

	char Query[7]; int Number;



	priority_queue<int> que;



	while (Query[2] != 'd')

	{

		scanf("%s", Query);



		if (Query[0] == 'i') { scanf("%d", &Number); que.push(Number); }

		if (Query[1] == 'x') { printf("%d\n", que.top()); que.pop(); }

	}



	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

#pragma warning(disable : 4996)

using namespace std;

int val, size_, heap[2097168]; char c[9];

inline void insert(int x) {

	int ptr = size_++; heap[ptr] = x;

	while (ptr > 1) {

		if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);

		ptr >>= 1;

	}

}

inline int extract() {

	int ret = heap[1], ptr = 1;

	while ((ptr << 1) + 1 < size_) {

		ptr <<= 1;

		if (heap[ptr] > heap[ptr + 1]) swap(heap[ptr >> 1], heap[ptr]);

		else swap(heap[ptr + 1], heap[ptr >> 1]), ptr++;

	}

	heap[ptr] = heap[--size_], heap[size_] = 0;

	while (ptr > 1) {

		if (heap[ptr >> 1] < heap[ptr]) swap(heap[ptr], heap[ptr >> 1]);

		ptr >>= 1;

	}

	return ret;

}

int main() {

	size_ = 1;

	while (scanf("%s", c), c[2] != 'd') {

		if (c[0] == 'i') scanf("%d", &val), insert(val);

		else printf("%d\n", extract());

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

#include<stdio.h>

#include<string>



void max_heapify(int* A, int i, int H)

{

    int l = 2 * i, r = 2 * i + 1;

    if(l > H && r > H) return;

    int maxid = i, x;

    if(l <= H) maxid = (A[l] > A[maxid] ? l : maxid);

    if(r <= H) maxid = (A[r] > A[maxid] ? r : maxid);

    if(maxid == i) return;

    x = A[maxid]; A[maxid] = A[i]; A[i] = x;

    max_heapify(A, maxid, H);

}



int main()

{

    int A[2000001];

    int i, H, key, x;

    char cmd[8];  // string cmd;

    scanf("%d", &H);

    for(i = 1; i <= H; i++) scanf("%d", &A[i]);

    H = 0;



    while(1){

        scanf("%s", cmd);  // cin >> cmd;

        if(cmd[2] == 'd') break;  // end.

        if(cmd[2] == 't'){  // extract.

            if(H == 0) continue;

            printf("%d\n", A[1]);

            A[1] = A[H]; H--;

            if(H > 0) max_heapify(A, 1, H);

        }else{

            cin >> key; H++;   // insert key.

            A[H] = key; i = H;

            while(i > 1){

                if(A[i] <= A[i / 2]) break;

                x = A[i];

                A[i] = A[i / 2];

                A[i / 2] = x;

                i = i / 2;

            };

        }

    };

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string>



void max_heapify(int* A, int i, int H)

{

    int l = 2 * i, r = 2 * i + 1;

    if(l > H && r > H) return;

    int maxid = i, x;

    if(l <= H) maxid = (A[l] > A[maxid] ? l : maxid);

    if(r <= H) maxid = (A[r] > A[maxid] ? r : maxid);

    if(maxid == i) return;

    x = A[maxid]; A[maxid] = A[i]; A[i] = x;

    max_heapify(A, maxid, H);

}



int main()

{

    int A[2000001];

    int i, H, key;

    char cmd[8];

    scanf("%d", &H);

    for(i = 1; i <= H; i++) scanf("%d", &A[i]);

    H = 0;



    while(1){

        scanf("%s", cmd);  

        if(cmd[2] == 'd') break;  // end.

        if(cmd[2] == 't'){  // extract.

            if(H == 0) continue;

            printf("%d\n", A[1]);

            A[1] = A[H]; H--;

            if(H > 0) max_heapify(A, 1, H);

        }else{

            scanf("%d", &key); // H++;   // insert key.

            i = ++H;

            while(i > 1){

                if(A[i / 2] > key) break;

                A[i] = A[i / 2];

                i /= 2;

            };

            A[i] = key;

        }

    };

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

char s[100005];

int ans[100005],n;

int check(){

	int flag=1,i;

	for(i=1;i<=n;i++){

		int l=i-1,r=i+1;

		if(l==0)l=n;

		if(r==n+1)r=1;

		if(ans[i]==1){

			if(s[i]=='o'&&ans[l]!=ans[r])return 0;

			if(s[i]=='x'&&ans[l]==ans[r])return 0;

		}

		else{

			if(s[i]=='o'&&ans[l]==ans[r])return 0;

			if(s[i]=='x'&&ans[l]!=ans[r])return 0;

		}

	}

	return 1;

}

void work(){

	for(int i=2;i<n;i++){

		if(ans[i]==1){

			if(s[i]=='o')ans[i+1]=ans[i-1];

			else ans[i+1]=(ans[i-1]==1?2:1);

		}

		else{

			if(s[i]=='o')ans[i+1]=(ans[i-1]==1?2:1);

			else ans[i+1]=ans[i-1];

		}

	}

}

int main(){

	int flag=0,i;

	scanf("%d",&n);

	scanf("%s",s+1);

	ans[1]=ans[2]=1;

	work();

	if(check()){

		for(i=1;i<=n;i++)printf("%c",ans[i]==1?'S':'W');

		printf("\n");

		return 0;

	}

	ans[1]=ans[2]=2;

	work();

	if(check()){

		for(i=1;i<=n;i++)printf("%c",ans[i]==1?'S':'W');

		printf("\n");

		return 0;

	}

	ans[1]=1;

	ans[2]=2;

	work();

	if(check()){

		for(i=1;i<=n;i++)printf("%c",ans[i]==1?'S':'W');

		printf("\n");

		return 0;

	}

	ans[2]=1;

	ans[1]=2;

	work();

	if(check()){

		for(i=1;i<=n;i++)printf("%c",ans[i]==1?'S':'W');

		printf("\n");

		return 0;

	}

	printf("-1\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>



const int MAXN = 1E5 + 10;



int n;

char s[MAXN];

int a[MAXN];



int main(){

	scanf("%d", &n);

	scanf("%s", s);

	s[n] = s[0], s[n + 1] = s[1];



	for (int i = 0; i < 4; ++i){

		a[0] = i & 1, a[1] = i >> 1 & 1;

		for (int j = 2; j <= n + 1; ++j)

			a[j] = s[j - 1] == 'x' ^ a[j - 1] ^ a[j - 2];

		if (a[0] == a[n] && a[1] == a[n + 1]){

			for (int j = 0; j < n; ++j)

				putchar(a[j] ? 'W' : 'S');

			puts("");

			return 0;

		}

	}

	puts("-1");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <map>

#include <set>

#include <cmath>

#include <ctime>

#include <stack>

#include <queue>

#include <cstdio>

#include <cctype>

#include <bitset>

#include <string>

#include <vector>

#include <cstring>

#include <iostream>

#include <iomanip>

#include <algorithm>

#include <functional>

#define fuck(x) cout<<"["<<x<<"]";

#define FIN freopen("input.txt","r",stdin);

#define FOUT freopen("output.txt","w+",stdout);

using namespace std;

typedef long long LL;

typedef pair<int, int> pii;

typedef long double ldb;



const int MX = 1e5 + 5;

const int INF = 0x3f3f3f3f;



int n;

bool ans[MX];

char S[MX], op[] = "SW";



bool check() {

    for(int i = 2; i <= n; i++) {

        if(S[i] == 'o') ans[i + 1] = ans[i - 1] ^ ans[i];

        else ans[i + 1] = ans[i - 1] ^ ans[i] ^ 1;

    }



    int ret = (ans[n + 1] == ans[1]);

    if(S[1] == 'o') ret &= (ans[n] == (ans[1] ^ ans[2]));

    else ret &= (ans[n] != (ans[1] ^ ans[2]));

    return ret;

}

int main() {

    // FIN;

    bool ok = 0;

    scanf("%d%s", &n, S + 1);

    for(int i = 0; i <= 1; i++) {

        for(int j = 0; j <= 1; j++) {

            ans[1] = i; ans[2] = j;



            if(check()) {

                ok = 1; goto ans;

            }

        }

    }

ans:

    if(!ok) printf("-1\n");

    else {

        for(int i = 1; i <= n; i++) {

            printf("%c", op[ans[i]]);

        }

        printf("\n");

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>



const int MAXN = 1E5 + 10;



int n;

char s[MAXN];

int a[MAXN];



int main(){

	scanf("%d", &n);

	scanf("%s", s);

	s[n] = s[0], s[n + 1] = s[1];



	for (int i = 0; i < 4; ++i){

		a[0] = i & 1, a[1] = i >> 1 & 1;

		for (int j = 2; j <= n + 1; ++j)

			a[j] = s[j - 1] == 'x' ^ a[j - 1] ^ a[j - 2];

		if (a[0] == a[n] && a[1] == a[n + 1]){

			for (int j = 0; j < n; ++j)

				putchar(a[j] ? 'W' : 'S');

			puts("");

			return 0;

		}

	}

	puts("-1");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstring>

using namespace std;

int  an[4][2]={{2, 2},{2,1},{1,1},{1,2}};//WW WS SS SW

int i,j,kind[100005],n;

char ans[100005];

int main()

{

    while(cin>>n&&(n>=3))

    {

        int flag=0;

        memset(kind,0,sizeof(kind));

        for(i=1;i<=n;i++)

        {

            cin>>ans[i];

        }



        for(j=0;j<4;j++)

        {

            kind[1]=an[j][0];

            kind[2]=an[j][1];

            for(i=2;i<=n;i++)

            {

             if(kind[i]==2)//is wolf

             {

                 if(ans[i]=='o') kind[i+1]=kind[i-1]%2+1;

                 else kind[i+1]=kind[i-1];

             }

             else if(kind[i]==1)

                 if(ans[i]=='x')  kind[i+1]=kind[i-1]%2+1;

                 else kind[i+1]=kind[i-1];

            }







            if(kind[n+1]==kind[1])

            {





                if(kind[1]==1)

                {

                    if(ans[1]=='o'&&kind[2]==kind[n]){flag++;break;}

                    if(ans[1]=='x'&&kind[2]!=kind[n]){flag++;break;}

                }

                else if(kind[1]==2)

                {

                    if(ans[1]=='x'&&kind[2]==kind[n]){flag++;break;}

                    if(ans[1]=='o'&&kind[2]!=kind[n]){flag++;break;}

                }

            }





        }



        if(flag==0)cout<<"-1"<<endl;

        else

        {





        for(i=1;i<=n;i++)

        {

            if(kind[i]==1)cout<<'S';

            else cout<<'W';

        }

            cout<<endl;

           // cout<<kind[n+1]<<endl;



        }

    }



}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstdlib>



const int MAXN=100011;



int N;

char str[MAXN];



bool isWolf[MAXN];



void Shift(){

	for(int i=2;i<N;++i){

		if(isWolf[i-1]){

			if(str[i-1]=='x')

				isWolf[i]=isWolf[i-2];

			else	isWolf[i]=!isWolf[i-2];

		}

		else{

			if(str[i-1]=='o')

				isWolf[i]=isWolf[i-2];

			else	isWolf[i]=!isWolf[i-2];

		}

	}

}



bool Test(int a){

	int p=a-1;if(p<0)	p+=N;

	int n=a+1;if(n>=N)	n-=N;

	if(isWolf[a]^(str[a]=='o'))

		return isWolf[p]==isWolf[n];

	return isWolf[p]!=isWolf[n];

}



bool Test(){

	bool ret=true;

	for(int i=0;i<N;++i){

		ret&=Test(i);

	}

	return ret;

}



void Show(){

	for(int i=0;i<N;++i){

		if(isWolf[i])

			printf("W");

		else	printf("S");

	}

	puts("");

	exit(0);

}



int main(){

	

	scanf("%d", &N);

	

	scanf("%s", str);

	

	isWolf[0]=false;isWolf[1]=false;

	Shift();

	if(Test())	Show();

	

	isWolf[0]=false;isWolf[1]=true;

	Shift();

	if(Test())	Show();

	

	isWolf[0]=true;isWolf[1]=false;

	Shift();

	if(Test())	Show();

	

	isWolf[0]=true;isWolf[1]=true;

	Shift();

	if(Test())	Show();

	

	puts("-1");

	

	return 0;

}

// Fastest known solution for this problem: