#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 6;
vector<pair<int, int> > white;
int n, m;
string s[N];
void Ok(int x, int y, int d) {
  if (x + d >= n || y + d >= m) return;
  for (auto a : white) {
    if (a.first != x && a.first != (x + d) && a.second != y &&
        a.second != (y + d))
      return;
  }
  for (int i = 0; i <= d; i++) {
    if (s[x + i][y] == '.') s[x + i][y] = '+';
    if (s[x][y + i] == '.') s[x][y + i] = '+';
    if (s[x + d][i + y] == '.') s[x + d][y + i] = '+';
    if (s[x + i][d + y] == '.') s[x + i][y + d] = '+';
  }
  for (int i = 0; i < n; i++) cout << s[i] << "\n";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  int mnX = n + 2, mxX = 0, mnY = m + 2, mxY = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == 'w') {
        white.push_back(make_pair(i, j));
        mnX = min(mnX, i);
        mxX = max(mxX, i);
        mnY = min(mnY, j);
        mxY = max(mxY, j);
      }
    }
  }
  int d = max(mxX - mnX, mxY - mnY);
  Ok(mnX, mnY, d);
  Ok(mnX, max(0, mxY - d), d);
  Ok(max(0, mxX - d), mnY, d);
  cout << "-1\n";
  return 0;
}
