#include <bits/stdc++.h>
using namespace std;
const int tam = 100010;
const int MOD = 1000000007;
const int MOD1 = 998244353;
const double EPS = 1e-9;
const double PI = acos(-1);
int tabla[2020][2020];
int get(int x0, int y0, int x1, int y1) {
  if (y0 > y1 || x0 > x1) return 0;
  return tabla[x1][y1] - tabla[x1][y0 - 1] - tabla[x0 - 1][y1] +
         tabla[x0 - 1][y0 - 1];
}
string tab[2020];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int can = 0;
  for (int i = 0; i < n; i++) {
    cin >> tab[i];
    for (int j = 0; j < m; j++) {
      tabla[i + 1][j + 1] = tab[i][j] == 'w';
      can += tabla[i + 1][j + 1];
    }
  }
  for (int i = 0; i < 2; i++)
    for (int j = 1; j < n + 1; j++)
      for (int k = 1; k < m + 1; k++) {
        if (i == 0)
          tabla[j][k] += tabla[j][k - 1];
        else
          tabla[j][k] += tabla[j - 1][k];
      }
  int lo, hi, mid, res, canti;
  int x, y, x0, y0;
  int lar = MOD;
  for (int i = 1; i < n + 1; i++)
    for (int j = 1; j < m + 1; j++) {
      lo = 1, hi = min(n - i + 1, m - j + 1), res = -1;
      while (lo <= hi) {
        mid = (lo + hi) / 2;
        if (get(i, j, i + mid - 1, j + mid - 1) == can)
          res = mid, hi = mid - 1;
        else
          lo = mid + 1;
      }
      if (res != -1 && get(i + 1, j + 1, i + res - 2, j + res - 2) == 0) {
        if (res < lar) {
          lar = res;
          x = i - 1;
          y = j - 1;
        }
      }
    }
  if (lar == MOD)
    cout << -1 << '\n';
  else {
    for (int i = 0; i < lar; i++) {
      if (tab[x][y + i] != 'w') tab[x][y + i] = '+';
      if (tab[x + i][y] != 'w') tab[x + i][y] = '+';
      if (tab[x + lar - 1][y + i] != 'w') tab[x + lar - 1][y + i] = '+';
      if (tab[x + i][y + lar - 1] != 'w') tab[x + i][y + lar - 1] = '+';
    }
    for (int i = 0; i < n; i++) cout << tab[i] << '\n';
  }
  return 0;
}
