unittest
{
	assert( [ "6", "ooxoox" ].parse.expand.solve == "SSSWWS" );
	assert( [ "3", "oox" ].parse.expand.solve == "-1" );
	assert( [ "10", "oxooxoxoox" ].parse.expand.solve == "SSWWSSSWWS" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	input.popFront;
	auto s = input.front;
	return tuple( s );
}

auto solve( string s )
{
	// 最初の二匹を仮定して整合性が取れるか判定
	foreach( a; [ "SS", "SW", "WW", "WS" ] )
	{
		auto ans = solve2( s, a );
		if( ans ) return ans.idup;
	}
	return "-1";
}

auto solve2( string s, string a )
{
	s ~= s[ 0 ];
	auto anss = new char[ s.length + 1 ];
	anss[ 0 .. 2 ] = a;
	for( auto i = 1L; i < s.length; i++ )
	{
		final switch( anss[ i - 1 .. i + 1 ] )
		{
			case "SS": anss[ i + 1 ] = ( s[ i ] == 'o' ) ? 'S' : 'W'; break;
			case "SW": anss[ i + 1 ] = ( s[ i ] == 'o' ) ? 'W' : 'S'; break;
			case "WW": anss[ i + 1 ] = ( s[ i ] == 'o' ) ? 'S' : 'W'; break;
			case "WS": anss[ i + 1 ] = ( s[ i ] == 'o' ) ? 'W' : 'S'; break;
		}
	}
	return ( anss[ 0 .. 2 ] == anss[ $ - 2 .. $ ] ) ? anss[ 0 .. $ - 2 ] : null;
}
