#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-10;
template <typename T>
T GCD(T a, T b);
template <typename T>
T EX_GCD(T a, T b, T& x, T& y);
template <typename T>
T POW(T x, T n);
bool correct(int x, int y, int size, vector<vector<char> >& t, int n, int m,
             int cnt) {
  if (x < 0 || y < 0 || x + size - 1 >= n || y + size - 1 >= m) return false;
  if (size == 1 && t[x][y] == 'w') return true;
  int num = 0;
  for (int j = (int)y; j < (int)y + size; j += 1) {
    if (t[x][j] == 'w') ++num;
    if (t[x + size - 1][j] == 'w') ++num;
  }
  for (int i = (int)x + 1; i < (int)x + size - 1; i += 1) {
    if (t[i][y] == 'w') ++num;
    if (t[i][y + size - 1] == 'w') ++num;
  }
  bool ok = (num == cnt);
  if (ok) {
    for (int j = (int)y; j < (int)y + size; j += 1) {
      if (t[x][j] != 'w') t[x][j] = '+';
      if (t[x + size - 1][j] != 'w') t[x + size - 1][j] = '+';
    }
    for (int i = (int)x + 1; i < (int)x + size - 1; i += 1) {
      if (t[i][y] != 'w') t[i][y] = '+';
      if (t[i][y + size - 1] != 'w') t[i][y + size - 1] = '+';
    }
  }
  return ok;
}
int SOLVE() {
  int n, m;
  cin >> n >> m;
  vector<vector<char> > t(n, vector<char>(m));
  int min_x = n, min_y = m, max_x = -1, max_y = -1;
  int cnt = 0;
  for (int i = (int)0; i < (int)n; i += 1) {
    for (int j = (int)0; j < (int)m; j += 1) {
      cin >> t[i][j];
      if (t[i][j] == 'w') {
        ++cnt;
        min_x = min(min_x, i);
        min_y = min(min_y, j);
        max_x = max(max_x, i);
        max_y = max(max_y, j);
      }
    }
  }
  int dx = max_x - min_x + 1, dy = max_y - min_y + 1;
  int size = max(dx, dy);
  int left_top_x[3] = {min_x, max_x - size + 1, 0},
      left_top_y[3] = {min_y, max_y - size + 1, 0};
  int x, y;
  for (int i = (int)0; i < (int)3; i += 1) {
    for (int j = (int)0; j < (int)3; j += 1) {
      x = left_top_x[i], y = left_top_y[j];
      if (correct(x, y, size, t, n, m, cnt)) {
        for (int i = (int)0; i < (int)n; i += 1) {
          for (int j = (int)0; j < (int)m; j += 1) cout << t[i][j];
          cout << endl;
        }
        return 0;
      }
    }
  }
  cout << -1 << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  return SOLVE();
}
template <typename T>
T GCD(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename T>
T EX_GCD(T a, T b, T& x, T& y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  T x_, y_;
  T gcd = EX_GCD(b, a % b, x_, y_);
  x = y_, y = x_ - (a / b) * y_;
  return gcd;
}
template <typename T>
T POW(T x, T n) {
  T result = 1;
  while (n) {
    if (n & 1) result *= x;
    x *= x;
    n >>= 1;
  }
  return result;
}
