#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int n, m, W, x, y, cnt, d[2015][2015], l, r, u, dd;
char a[2015][2015];
int get(int x, int y, int v, int u) {
  if (x > v || y > u) return 0;
  return d[v][u] - d[v][y - 1] - d[x - 1][u] + d[x - 1][y - 1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
      d[i][j] = d[i - 1][j] + d[i][j - 1] - d[i - 1][j - 1] + (a[i][j] == 'w');
      if (a[i][j] == 'w') x = i, y = j;
    }
  }
  l = r = y;
  u = dd = x;
  cnt = d[n][m];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      if (a[i][j] == 'w') {
        W = max(W, (int)max(abs(i - x), abs(y - j)));
        l = min(l, j);
        r = max(r, j);
        u = min(u, i);
        dd = max(dd, i);
      }
  }
  W = max(W, max(r - l, dd - u));
  pair<int, int> ans = make_pair(0, 0);
  for (int i = 1; i <= n - W; i++) {
    for (int j = 1; j <= m - W; j++) {
      if (get(i, j, i + W, j + W) == cnt &&
          get(i + 1, j + 1, i + W - 1, j + W - 1) == 0)
        ans = make_pair(i, j);
    }
  }
  if (ans == make_pair(0, 0))
    cout << -1;
  else {
    for (int i = 0; i <= W; i++) {
      if (a[ans.first][ans.second + i] == '.')
        a[ans.first][ans.second + i] = '+';
      if (a[ans.first + i][ans.second] == '.')
        a[ans.first + i][ans.second] = '+';
      if (a[ans.first + W][ans.second + i] == '.')
        a[ans.first + W][ans.second + i] = '+';
      if (a[ans.first + i][ans.second + W] == '.')
        a[ans.first + i][ans.second + W] = '+';
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) cout << a[i][j];
      cout << "\n";
    }
  }
}
