#include <bits/stdc++.h>
using namespace std;
char G[2005][2005];
int n, m;
bool fit(int x, int y) { return x >= 1 && x <= n && y >= 1 && y <= m; }
bool okok(int x0, int y0, int d) {
  if (!fit(x0, y0) || !fit(x0 + d - 1, y0) || !fit(x0, y0 + d - 1) ||
      !fit(x0 + d - 1, y0 + d - 1))
    return 0;
  int y1 = y0 + d - 1, x1 = x0 + d - 1;
  for (int(i) = (int)(1); (i) <= (int)(n); ++(i))
    for (int(j) = (int)(1); (j) <= (int)(m); ++(j))
      if (G[i][j] == 'w' && i != x0 && i != x1 && j != y0 && j != y1) return 0;
  for (int(i) = (int)(x0); (i) <= (int)(x0 + d - 1); ++(i))
    G[i][y0] = G[i][y0] == 'w' ? 'w' : '+',
    G[i][y1] = G[i][y1] == 'w' ? 'w' : '+';
  for (int(j) = (int)(y0); (j) <= (int)(y0 + d - 1); ++(j))
    G[x0][j] = G[x0][j] == 'w' ? 'w' : '+',
    G[x1][j] = G[x1][j] == 'w' ? 'w' : '+';
  for (int(i) = (int)(1); (i) <= (int)(n); ++(i)) puts(G[i] + 1);
  return 1;
}
int main(int argc, char const *argv[]) {
  cin >> n >> m;
  for (int(i) = (int)(1); (i) <= (int)(n); ++(i)) cin >> (G[i] + 1);
  int minx = n + 1, maxx = 0, miny = m + 1, maxy = 0, cnt = 0;
  for (int(i) = (int)(1); (i) <= (int)(n); ++(i))
    for (int(j) = (int)(1); (j) <= (int)(m); ++(j))
      if (G[i][j] == 'w' && ++cnt)
        minx = min(minx, i), maxx = max(maxx, i), miny = min(miny, j),
        maxy = max(maxy, j);
  if (!cnt) {
    for (int(i) = (int)(1); (i) <= (int)(n); ++(i)) puts(G[i] + 1);
    return 0;
  }
  int xlen = maxx - minx + 1, ylen = maxy - miny + 1;
  int len = max(xlen, ylen);
  if (okok(minx, miny, len)) return 0;
  if (okok(minx, max(maxy - len + 1, 1), len)) return 0;
  if (okok(max(maxx - len + 1, 1), miny, len)) return 0;
  puts("-1");
  return 0;
}
