Problem:
Snuke, who loves animals, built a zoo.  There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1.  There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies.  Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species.  More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise.  Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
s = input()

print("WWSSSS")

Fixed, accepted submission:
N = int(input())
s = str(input())
A = ''

def majikayo():
    k = 0
    if A[0] == 'S' and s[0] == 'o':
        if A[-1] == 'S' and s[-1] == 'o':
            if A[1] == 'S' and A[-2] == 'S':
                k = 1
        elif A[-1] == 'S' and s[-1] == 'x':
            if A[1] == 'S' and A[-2] == 'W':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'o':
            if A[1] == 'W' and A[-2] == 'W':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'x':
            if A[1] == 'W' and A[-2] == 'S':
                k = 1
    elif A[0] == 'S' and s[0] == 'x':
        if A[-1] == 'S' and s[-1] == 'o':
            if A[1] == 'W' and A[-2] == 'S':
                k = 1
        elif A[-1] == 'S' and s[-1] == 'x':
            if A[1] == 'W' and A[-2] == 'W':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'o':
            if A[1] == 'S' and A[-2] == 'W':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'x':
            if A[1] == 'S' and A[-2] == 'S':
                k = 1
    elif A[0] == 'W' and s[0] == 'o':
        if A[-1] == 'S' and s[-1] == 'o':
            if A[1] == 'W' and A[-2] == 'W':
                k = 1
        elif A[-1] == 'S' and s[-1] == 'x':
            if A[1] == 'W' and A[-2] == 'S':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'o':
            if A[1] == 'S' and A[-2] == 'S':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'x':
            if A[1] == 'S' and A[-2] == 'W':
                k = 1
    elif A[0] == 'W' and s[0] == 'x':
        if A[-1] == 'S' and s[-1] == 'o':
            if A[1] == 'S' and A[-2] == 'W':
                k = 1
        elif A[-1] == 'S' and s[-1] == 'x':
            if A[1] == 'S' and A[-2] == 'S':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'o':
            if A[1] == 'W' and A[-2] == 'S':
                k = 1
        elif A[-1] == 'W' and s[-1] == 'x':
            if A[1] == 'W' and A[-2] == 'W':
                k = 1
    if k == 1:
        return 1

A = 'SS'
for i in range(1,N-1):
    if s[i] == 'o' and A[i] == 'S':
        if A[i-1] == 'S':
            A += 'S'
        else:
            A += 'W'
    elif s[i] == 'o' and A[i] == 'W':
        if A[i-1] == 'S':
            A += 'W'
        else:
            A += 'S'
    elif s[i] == 'x' and A[i] == 'S':
        if A[i-1] == 'S':
            A += 'W'
        else:
            A += 'S'
    elif s[i] == 'x' and A[i] == 'W':
        if A[i-1] == 'S':
            A += 'S'
        else:
            A += 'W'
if majikayo() == 1:
    print(A)
else:
    A = 'SW'
    for i in range(1,N-1):
        if s[i] == 'o' and A[i] == 'S':
            if A[i-1] == 'S':
                A += 'S'
            else:
                A += 'W'
        elif s[i] == 'o' and A[i] == 'W':
            if A[i-1] == 'S':
                A += 'W'
            else:
                A += 'S'
        elif s[i] == 'x' and A[i] == 'S':
            if A[i-1] == 'S':
                A += 'W'
            else:
                A += 'S'
        elif s[i] == 'x' and A[i] == 'W':
            if A[i-1] == 'S':
                A += 'S'
            else:
                A += 'W'
    if majikayo() == 1:
        print(A)
    else:
        k = 0
        A = 'WS'
        for i in range(1,N-1):
            if s[i] == 'o' and A[i] == 'S':
                if A[i-1] == 'S':
                    A += 'S'
                else:
                    A += 'W'
            elif s[i] == 'o' and A[i] == 'W':
                if A[i-1] == 'S':
                    A += 'W'
                else:
                    A += 'S'
            elif s[i] == 'x' and A[i] == 'S':
                if A[i-1] == 'S':
                    A += 'W'
                else:
                    A += 'S'
            elif s[i] == 'x' and A[i] == 'W':
                if A[i-1] == 'S':
                    A += 'S'
                else:
                    A += 'W'
        majikayo()
        if majikayo() == 1:
            print(A)
        else:
            k = 0
            A = 'WW'
            for i in range(1,N-1):
                if s[i] == 'o' and A[i] == 'S':
                    if A[i-1] == 'S':
                        A += 'S'
                    else:
                        A += 'W'
                elif s[i] == 'o' and A[i] == 'W':
                    if A[i-1] == 'S':
                        A += 'W'
                    else:
                        A += 'S'
                elif s[i] == 'x' and A[i] == 'S':
                    if A[i-1] == 'S':
                        A += 'W'
                    else:
                        A += 'S'
                elif s[i] == 'x' and A[i] == 'W':
                    if A[i-1] == 'S':
                        A += 'S'
                    else:
                        A += 'W'
            if majikayo() == 1:
                print(A)
            else:
                print(-1)