#include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#define debug(a) cout << "*" << a << "*" << endl
using namespace std;
typedef long long ll;
char mp[50][101];
int m, n;
void fill_mp(int num, int x, char ch)
{
	for (int i = x; ; i += 2)
	{
		for (int j = 0; j < 100; j += 2)
		{
			if (num == 0)	return;
			mp[i][j] = ch;
			num--;
		}
	}
}
int main()
{
	while (~scanf("%d%d", &m, &n))
	{
		for (int i = 0; i < 25; i++)
		{
			memset(mp[i], '#', sizeof(mp[i]));
		}
		for (int i = 25; i < 50; i++)
		{
			memset(mp[i], '.', sizeof(mp[i]));
		}
		for (int i = 0; i < 50; i++)	mp[i][100] = 0;
		m--, n--;
		fill_mp(m, 0, '.'), fill_mp(n, 26, '#');
		printf("50 100\n");
		for (int i = 0; i < 50; i++)	printf("%s\n", mp[i]);
	}
}

#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  vi v1(n);
  rep(i,n){
    if (i == 0){
      v1.at(i) = 0;
      continue;
    }
    v1.at(i) += v1.at(i-1) ;
    if (s.at(i-1) == 'W') v1.at(i)++;
  }
  vi v2(n);
  rep(i,n){
    if (i == 0){
      v2.at(i) = 0;
      continue;
    }
    v2.at(i) += v2.at(i-1);
    if (s.at(n-i) == 'E') v2.at(i)++;
  }
  vi v3(n);
  rep(i,n){
    v3.at(i) = v1.at(i) + v2.at(n-1-i);
  }
  sort(v3.begin(),v3.end());
  cout << v3.at(0) << endl;
  return 0;
}
