#include <bits/stdc++.h>
using namespace std;
const int n_max = 2005;
int n, m, i, j, k, s[n_max][n_max], X, Y, l;
int xmin, ymin, ansmin = 2000000;
char c[n_max][n_max];
int sum(int x1, int y1, int x2, int y2) {
  if (!(x1 <= x2) || !(y1 <= y2)) return 0;
  return s[x2][y2] - s[x1 - 1][y2] - s[x2][y1 - 1] + s[x1 - 1][y1 - 1];
}
bool check(int x, int y, int l) {
  if (!(x + l - 1 <= n && y + l - 1 <= m)) return 0;
  int xx = x + l - 1, yy = y + l - 1, a, b;
  a = sum(x, y, xx, yy);
  b = sum(x + 1, y + 1, xx - 1, yy - 1);
  return (a == s[n][m] && b == 0);
}
void answer(int X, int Y, int l) {
  int i;
  for (i = Y; i <= Y + l - 1; i++)
    if (c[X][i] != 'w') c[X][i] = '+';
  for (i = Y; i <= Y + l - 1; i++)
    if (c[X + l - 1][i] != 'w') c[X + l - 1][i] = '+';
  for (i = X; i <= X + l - 1; i++)
    if (c[i][Y] != 'w') c[i][Y] = '+';
  for (i = X; i <= X + l - 1; i++)
    if (c[i][Y + l - 1] != 'w') c[i][Y + l - 1] = '+';
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) cout << c[i][j];
    cout << endl;
  }
  exit(0);
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) cin >> (c[i] + 1);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      s[i][j] =
          s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + (int)(c[i][j] == 'w');
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (c[i][j] == 'w') X = i, Y = j;
  k = (n < m ? n : m);
  for (j = 1; j <= m; j++)
    for (l = 1; l <= k; l++)
      if (check(X, j, l))
        if (l < ansmin) ansmin = l, xmin = X, ymin = j;
  for (i = 1; i <= n; i++)
    for (l = 1; l <= k; l++)
      if (check(i, Y, l))
        if (l < ansmin) ansmin = l, xmin = i, ymin = Y;
  for (j = 1; j <= m; j++)
    for (l = 1; l <= k; l++)
      if (X - l + 1 > 0 && check(X - l + 1, j, l))
        if (l < ansmin) ansmin = l, xmin = X - l + 1, ymin = j;
  for (i = 1; i <= n; i++)
    for (l = 1; l <= k; l++)
      if (Y - l + 1 > 0 && check(i, Y - l + 1, l))
        if (l < ansmin) ansmin = l, xmin = i, ymin = Y - l + 1;
  if (xmin != 0) answer(xmin, ymin, ansmin);
  cout << -1 << endl;
}
