#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}

int main(){
    struct dice{int u,e,w,n,s,d;
    void rotate(char c){
        int temp=u;
        if(c=='E'){u=w;w=d;d=e;e=temp;}
        else if(c=='W'){u=e;e=d;d=w;w=temp;}
        else if(c=='N'){u=s;s=d;d=n;n=temp;}
        else if(c=='S'){u=n;n=d;d=s;s=temp;}
    }
    bool hikaku(dice q){
        int counter=0;
        if(u==q.u)counter++;
        if(s==q.s)counter++;
        if(e==q.e)counter++;
        if(w==q.w)counter++;
        if(n==q.n)counter++;
        if(d==q.d)counter++;
        if(counter==6)return true;else return false;
    }
    };
    int n;
    in(n);
    vector<dice> vec(n);
    rep(i,n){
        in(vec[i].u,vec[i].s,vec[i].e,vec[i].w,vec[i].n,vec[i].d);
    }
    string s="NNNNENNNN";
    for(int j=0;j<n-1;j++){
        for(int k=j+1;k<n;k++){
            dice a=vec[j];
            dice b=vec[k];
        rep(i,9){
            if(a.s==b.s)break;
            b.rotate(s[i]);
        }
        int counter=0;
        while(!a.hikaku(b)){
            b.rotate('E');
            counter++;
            if(counter>=5){
                goto skip;
            }
        }
        out("No");
        return 0;
        skip: ;
        }
    }
    out("Yes");
}

#include <bits/stdc++.h>
using namespace std;

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll n; cin >> n;
    string s; cin >> s;
    rep(bit,4){ //４通りを考える SS,SW,WS,WW S:0, W:1
        vl a(n+1);
        rep(i,2){
            if( (bit>>i) & 1)a[i] = 1;
            else a[i] = 0;
        }
        //cout << a[0] << " " << a[1] << endl;
        for(int i=1;i<n;i++){
            if(a[i] == 0 && s[i] == 'o')a[i+1] = a[i-1];
            if(a[i] == 0 && s[i] == 'x')a[i+1] = !a[i-1];
            if(a[i] && s[i] == 'o')a[i+1] = !a[i-1];
            if(a[i] && s[i] == 'x')a[i+1] = a[i-1];
        }
        //仮定したaの並びで文字列を生成する
        string res;
        rep(i,n){
            int pre = (i- 1 + n) % n;
            int next = (i + 1) % n;
            if(a[i] == 0){
                if(a[pre] == a[next])res+='o';
                else res+='x';
            }
            else{
                if(a[pre] == a[next])res+='x';
                else res+='o';
            }
        }
        //仮定が合っていたら
        if(res == s){
            rep(i,n){
                if(a[i] == 0)cout << 'S';
                else cout << 'W';
            }
            cout << endl;
            return 0;
        }
    }
    out(-1);
}
