#include <iostream>
#include <vector>

using namespace std;
bool isW(char c){
    return c=='W';
}
bool isX(char c){
    return c=='x';
}
int main(){//D問題
    int n;
    string s;
    cin >> n >> s;
    vector<char> t(n);
    char assum[4][2] = {{'S', 'S'}, {'S', 'W'}, {'W', 'S'}, {'W', 'W'}};
    for(int i=0;i<4;++i){
        t[0] = assum[i][0];
        t[1] = assum[i][1];
        for(int j=1;j<n-1;++j){
            t[j+1] = isW(t[j-1])^isX(s[j])^isW(t[j]) ? 'W' : 'S';
        }
        if(!(isW(t[n-2])^isX(s[n-1])^isW(t[n-1])^isW(t[0]) || isW(t[n-1])^isX(s[0])^isW(t[0])^isW(t[1]))){
            for(char c : t){
                cout << c;
            }
            return 0;
        }
    }
    cout << "-1";
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define all(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
const int mod = 1e9+7;

int main() {
    int n, T;
    cin >> n >> T;
    int t[n];
    rep(i, n) {
        cin >> t[i];
    }
    ll ans = 0;
    rep(i, n) {
        if (i+1 < n) {
            ans += min(T, t[i+1] - t[i]);
        } else {
            ans += T;
        }
    }
    cout << ans << endl;
}
