Scanf.scanf "%d %s" (fun n s ->
    let assume c1 c2 =
        let r = Array.make n '.' in
        r.(0) <- c1;
        r.(1) <- c2;
        let rev k = if k = 'S' then 'W' else 'S' in
        for i = 2 to n - 1 do
            r.(i) <- match r.(i - 1), s.[i - 1] with
            | 'S', 'o' 
            | 'W', 'x' -> r.(i - 2)
            | _        -> rev r.(i - 2)
        done;

        let check p =
            let pp = r.((p - 1 + n) mod n) in
            let pn = r.((p + 1 + n) mod n) in
            match r.(p), s.[p] with
            | 'S', 'o'
            | 'W', 'x' -> pp = pn
            | _        -> pp = rev pn
        in

        if check (n - 1) && check 0 then  (
            Array.iter print_char r;
            print_newline ();
            true
        ) else false
    in
    if assume 'S' 'S' || assume 'S' 'W' || assume 'W' 'S' || assume 'W' 'W' then () else
        print_endline "-1"
)