#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long N, M;
  cin >> N >> M;
  char board[N][M];
  long long minx = 100000, maxx = 0, miny = 100000, maxy = 0, total = 0;
  for (long long i = 0; i < N; i++)
    for (long long j = 0; j < M; j++) {
      cin >> board[i][j];
      if (board[i][j] == 'w') {
        minx = min(minx, i);
        maxx = max(maxx, i);
        miny = min(miny, j);
        maxy = max(maxy, j);
        total++;
      }
    }
  long long size = max(maxx - minx, maxy - miny) + 1;
  long long x[3] = {0, minx, maxx - size + 1},
            y[3] = {0, miny, maxy - size + 1};
  bool success = false;
  for (long long i = 0; i < 3; i++) {
    for (long long j = 0; j < 3; j++) {
      if (x[i] < 0 || x[i] + size - 1 >= N || y[j] < 0 || y[j] + size - 1 >= M)
        continue;
      long long counter = 0;
      for (long long k = 0; k < size - 1; k++)
        if (board[x[i]][y[j] + k] == 'w') counter++;
      for (long long k = 0; k < size - 1; k++)
        if (board[x[i] + k][y[j] + size - 1] == 'w') counter++;
      for (long long k = 0; k < size - 1; k++)
        if (board[x[i] + size - 1][y[j] + size - 1 - k] == 'w') counter++;
      for (long long k = 0; k < size - 1; k++)
        if (board[x[i] + size - 1 - k][y[j]] == 'w') counter++;
      if (counter == total || size == 1 && board[x[i]][y[j]] == 'w') {
        success = true;
        for (long long k = 0; k < size - 1; k++)
          if (board[x[i]][y[j] + k] != 'w') board[x[i]][y[j] + k] = '+';
        for (long long k = 0; k < size - 1; k++)
          if (board[x[i] + k][y[j] + size - 1] != 'w')
            board[x[i] + k][y[j] + size - 1] = '+';
        for (long long k = 0; k < size - 1; k++)
          if (board[x[i] + size - 1][y[j] + size - 1 - k] != 'w')
            board[x[i] + size - 1][y[j] + size - 1 - k] = '+';
        for (long long k = 0; k < size - 1; k++)
          if (board[x[i] + size - 1 - k][y[j]] != 'w')
            board[x[i] + size - 1 - k][y[j]] = '+';
        break;
      }
    }
    if (success) break;
  }
  if (success)
    for (long long i = 0; i < N; i++) {
      for (long long j = 0; j < M; j++) cout << board[i][j];
      cout << endl;
    }
  else
    cout << -1 << endl;
  return 0;
}
