#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:600000000")
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
double const pi = 3.1415926535897932384626433832795;
int const inf = (int)1e9;
long long const inf64 = (long long)4e18;
const string name = "d";
const int NMAX = 2014;
char s[NMAX][NMAX];
int n, m, k;
vector<int> x, y;
void maybe(int x1, int qqqqqqq, int x2, int y2) {
  if (x1 == x2 && qqqqqqq == y2 && k == 1 && s[x1][qqqqqqq] == 'w') {
    for (int i = 0; i < (int)n; i++) {
      printf("%s\n", s[i]);
    }
    exit(0);
  }
  int cnt = 0;
  for (int i = x1; i <= x2; ++i) {
    cnt += (s[i][qqqqqqq] == 'w');
    cnt += (s[i][y2] == 'w');
  }
  for (int i = qqqqqqq; i <= y2; ++i) {
    cnt += (s[x1][i] == 'w');
    cnt += (s[x2][i] == 'w');
  }
  if (s[x1][qqqqqqq] == 'w') cnt--;
  if (s[x1][y2] == 'w') cnt--;
  if (s[x2][qqqqqqq] == 'w') cnt--;
  if (s[x2][y2] == 'w') cnt--;
  if (cnt == k) {
    for (int i = x1; i <= x2; ++i) {
      if (s[i][qqqqqqq] == '.') s[i][qqqqqqq] = '+';
      if (s[i][y2] == '.') s[i][y2] = '+';
    }
    for (int i = qqqqqqq; i <= y2; ++i) {
      if (s[x1][i] == '.') s[x1][i] = '+';
      if (s[x2][i] == '.') s[x2][i] = '+';
    }
    for (int i = 0; i < (int)n; i++) {
      printf("%s\n", s[i]);
    }
    exit(0);
  }
}
int main() {
  cin >> n >> m;
  k = 0;
  for (int i = 0; i < (int)n; i++) {
    scanf("%s", s[i]);
    for (int j = 0; j < (int)m; j++)
      if (s[i][j] == 'w') {
        x.push_back(i);
        y.push_back(j);
        k++;
      }
  }
  if (k > min(n, m) * 4) {
    cout << -1 << endl;
    return 0;
  }
  sort((x).begin(), (x).end());
  sort((y).begin(), (y).end());
  int dx = x[x.size() - 1] - x[0] + 1;
  int dy = y[y.size() - 1] - y[0] + 1;
  int s = max(dx, dy);
  if (dx == s) {
    for (int i = 0; i < (int)m - s + 1; i++)
      maybe(x[0], i, x[0] + s - 1, i + s - 1);
  }
  if (dy == s) {
    for (int i = 0; i < (int)n - s + 1; i++)
      maybe(i, y[0], i + s - 1, y[0] + s - 1);
  }
  cout << -1 << endl;
  return 0;
}
