#include using namespace std; #define FOR(i, a, b) for(int i = (a); i < (b); i++) #define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--) #define SZ(a) int(a.size()) #define ALL(a) a.begin(), a.end() #define PB push_back #define MP make_pair #define F first #define S second typedef long long LL; typedef vector VI; typedef pair PII; typedef double db; const int N = 25; int ans[N][N]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; FOR(i, 0, n) { string s; cin >> s; FOR(j, 0, n) { if(s[j] == 'S' || s[j] == 'F') ans[i][j] = (s[j] == 'F'); else ans[i][j] = -1; } } int cntBad = 0; int x = 0; FOR(i, 0, n) { FOR(j, 0, n) { if(ans[i][j] != -1) { cntBad += ans[i][j] != (x ^ (i + j < n) ^ 1); } } } if(cntBad >= n / 2) x ^= 1; FOR(i, 0, n) { FOR(j, 0, n) { if(i == j) { cout << '.'; continue; } if(ans[i][j] == -1) ans[i][j] = x ^ (i + j < n) ^ 1; cout << (ans[i][j] == 0 ? 'S' : 'F'); } cout << "\n"; } return 0; }