stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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);

        }

    }

}




// Faster C++ solution for the same problem (measured speedup: 9.311378161898569x):
#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();

        }

    }

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 4.78819151481499x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 4.78819151481499x):
#include <stdio.h>

#include <algorithm>

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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 4.78819151481499x):
#include <stdio.h>

#include <algorithm>

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[3]) {

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

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

	}

	return 0;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.151076355798838x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.151076355798838x):
#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){ if(A[l] > A[maxid]) maxid = l; }

    if(r <= H){ if(A[r] > A[maxid]) maxid = r; }

    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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.244098041165652x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.242505384308248x):
#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;

}
// Slower C++ solution:
#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;



        }

    }



}


// Faster C++ solution for the same problem (measured speedup: 1.4178040776949679x):
#include<iostream>

#include<cstring>

#include<cstdio>

#include<algorithm>

#include<queue>

#include<vector>

#include<cmath>

#include<stack>

using namespace std;

bool vis[220010];

char s[220010];

bool check(int x, int y, int len)

{

    vis[0]=x;

    vis[1]=y;

    for(int i=2; i<=len+1; i++)

    {

        if(vis[i-1])

        {

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

                vis[i]=vis[i-2];

            else 

                vis[i]=!vis[i-2];

        }

        else

        {

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

                vis[i]=!vis[i-2];

            else 

                vis[i]=vis[i-2];

        }

    }

    if(vis[len]==vis[0]&&vis[len+1]==vis[1])

    {

        for(int i=0;i<len;i++)

        {

            if(vis[i])

                printf("S");

            else

                printf("W");

        }

        puts("");

        return 1;

    }

    return 0;

}

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        scanf("%s",s);

        int len=n;

        s[len]=s[0];

        s[len+1]=s[1];

        s[len+2]='\0';

        bool fl=0;

        for(int i=0;i<2;i++)

        {

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

            {

                if(check(i,j,len))

                {

                    fl=1;

                    break;

                }

            }

            if(fl) 

                break;

        }

        if(!fl)

            puts("-1\n");

    }

    return 0;

}
// Slower C++ solution:
#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;



        }

    }



}


// Faster C++ solution for the same problem (measured speedup: 1.4073483159769689x):
#include<iostream>

using namespace std;

int n;

char arr[100000];

char brr[100000];

int pd(char a,char b)

{

	brr[0]=a;

	brr[1]=b;

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

	{

		if(brr[i]=='S'&&arr[i]=='o'||brr[i]=='W'&&arr[i]=='x')

		{

			brr[i+1]=brr[i-1];

		}

		else

		{

			if(brr[i-1]=='S')

			{

				brr[i+1]='W';

			}

			else

			{

				brr[i+1]='S';

			}

		}

	}

	char t;

	if(brr[n-1]=='S'&&arr[n-1]=='o'||brr[n-1]=='W'&&arr[n-1]=='x')

	{

		t=brr[n-2];

	}

	else

	{

		if(brr[n-2]=='S')

		{

			t='W';

		}

		else

		{

			t='S';

		}

	}

	if(t==brr[0])

	{

		if(brr[0]=='S'&&arr[0]=='o'||brr[0]=='W'&&arr[0]=='x')

		{

			if(brr[1]==brr[n-1])

			{

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

				{

					cout<<brr[i];

				}

				return 0;

			}

		}

		else

		{

			if(brr[1]!=brr[n-1])

			{

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

				{

					cout<<brr[i];

				}

				return 0;

			}

		}

	}

	return 1;

}

int main()

{

	cin>>n;

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

	{

		cin>>arr[i];

	}

	char crr[4][2]={'W','W','W','S','S','S','S','W'};

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

	{

		if(pd(crr[i][0],crr[i][1])==0)

			return 0;

	}

	cout<<-1;

}
// Slower C++ solution:
#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;



        }

    }



}


// Faster C++ solution for the same problem (measured speedup: 1.4185971881904793x):
#include<bits/stdc++.h>

using namespace std;



int zz[100005],n;

char dat[100005];



bool check(){

	if(!((dat[0]=='x')==zz[1]^zz[n-1]^zz[0])) return false;

	if(!((dat[n-1]=='x')==zz[n-2]^zz[n-1]^zz[0])) return false;

	return true;

}



int main(){

	scanf("%d%s",&n,dat);

	

	dat[0];

	

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

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

			zz[1]=i;

			zz[0]=j;

			for(int k=1;k<n-1;k++)

				zz[k+1]=zz[k-1]^zz[k]^(dat[k]=='x');

			if(check()){

				for(int k=0;k<n;k++) printf("%c",zz[k]?'W':'S');

				return 0;

			}

		}

	}

	

	printf("-1\n");

	return 0;

}