#include <bits/stdc++.h>
using namespace std;
const int maxN = 2005;
char a[maxN][maxN];
int n, m;
vector<pair<int, int> > p;
int xmax, xmin, ymax, ymin;
bool Check(int first, int second, int d) {
  if (first < 1 || second < 1 || first + d > n || second + d > m) return false;
  for (int i = 0; i < (int)p.size(); ++i)
    if (p[i].first != first && p[i].first != first + d &&
        p[i].second != second && p[i].second != second + d)
      return false;
  for (int i = 0; i <= d; ++i) {
    if (a[first][second + i] == '.') a[first][second + i] = '+';
    if (a[first + d][second + i] == '.') a[first + d][second + i] = '+';
    if (a[first + i][second] == '.') a[first + i][second] = '+';
    if (a[first + i][second + d] == '.') a[first + i][second + d] = '+';
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) printf("%c", a[i][j]);
    printf("\n");
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  scanf("%d%d\n", &n, &m);
  xmax = 0;
  ymax = 0;
  ymin = 1e9;
  xmin = 1e9;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      scanf("%c", &a[i][j]);
      if (a[i][j] == 'w') {
        p.push_back(pair<int, int>(i, j));
        xmax = max(i, xmax);
        ymax = max(j, ymax);
        ymin = min(ymin, j);
        xmin = min(xmin, i);
      }
    }
    scanf("\n");
  }
  int d = max(ymax - ymin, xmax - xmin);
  if (Check(xmin, ymin, d)) return 0;
  if (Check(xmin, max(1, ymax - d), d)) return 0;
  if (Check(max(1, xmax - d), ymin, d)) return 0;
  printf("%d", -1);
  return 0;
}
