#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
int n, m;
char mp[maxn][maxn];
int pre[maxn][maxn];
int calc(int x, int y, int p, int q) {
  if (x > p || y > q) return 0;
  return pre[p][q] - pre[p][y - 1] - pre[x - 1][q] + pre[x - 1][y - 1];
}
int check(int x, int y, int p, int q) {
  int res = 0;
  for (int i = x; i <= p; i++) {
    if (mp[i][y] == 'w') res++;
    if (mp[i][q] == 'w') res++;
  }
  for (int i = y; i <= q; i++) {
    if (mp[x][i] == 'w') res++;
    if (mp[p][i] == 'w') res++;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> mp[i][j];
    }
  }
  int l = m + 1, r = -1, u = n + 1, d = -1;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int val = 0;
      if (mp[i][j] == 'w') val = 1, cnt++;
      pre[i][j] = pre[i - 1][j] + pre[i][j - 1] - pre[i - 1][j - 1] + val;
      if (mp[i][j] == 'w') {
        l = min(l, j);
        r = max(r, j);
        u = min(u, i);
        d = max(d, i);
      }
    }
  }
  int len = max(abs(l - r), abs(u - d));
  int ok = true;
  int ansx = 0, ansy = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i + len - 1 > n || j + len - 1 > m) continue;
      int sum = calc(i, j, i + len, j + len) -
                calc(i + 1, j + 1, i + len - 1, j + len - 1);
      if (sum == cnt) {
        ansx = i;
        ansy = j;
        break;
      }
    }
    if (ansx) break;
  }
  if (ansx == 0) {
    puts("-1");
    return 0;
  }
  int xx = ansx + len, yy = ansy + len;
  for (int i = ansy; i <= yy; i++) {
    if (mp[ansx][i] != 'w') mp[ansx][i] = '+';
    if (mp[xx][i] != 'w') mp[xx][i] = '+';
  }
  for (int i = ansx; i <= xx; i++) {
    if (mp[i][ansy] != 'w') mp[i][ansy] = '+';
    if (mp[i][yy] != 'w') mp[i][yy] = '+';
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      printf("%c", mp[i][j]);
    }
    puts("");
  }
  return 0;
}
