Innocentius has a problem — his computer monitor has broken. Now some of the pixels are "dead", that is, they are always black. As consequence, Innocentius can't play the usual computer games. He is recently playing the following game with his younger brother Polycarpus.

Innocentius is touch-typing a program that paints a white square one-pixel wide frame on the black screen. As the monitor is broken, some pixels that should be white remain black. Polycarpus should look at what the program displayed on the screen and guess the position and size of the frame Innocentius has painted. Polycarpus doesn't like the game but Innocentius persuaded brother to play as "the game is good for the imagination and attention".

Help Polycarpus, automatize his part in the gaming process. Write the code that finds such possible square frame that:

  * the frame's width is 1 pixel, 
  * the frame doesn't go beyond the borders of the screen, 
  * all white pixels of the monitor are located on the frame, 
  * of all frames that satisfy the previous three conditions, the required frame must have the smallest size. 



Formally, a square frame is represented by such pixels of the solid square, that are on the square's border, that is, are not fully surrounded by the other pixels of the square. For example, if the frame's size is d = 3, then it consists of 8 pixels, if its size is d = 2, then it contains 4 pixels and if d = 1, then the frame is reduced to a single pixel.

Input

The first line contains the resolution of the monitor as a pair of integers n, m (1 ≤ n, m ≤ 2000). The next n lines contain exactly m characters each — the state of the monitor pixels at the moment of the game. Character "." (period, ASCII code 46) corresponds to the black pixel, and character "w" (lowercase English letter w) corresponds to the white pixel. It is guaranteed that at least one pixel of the monitor is white.

Output

Print the monitor screen. Represent the sought frame by characters "+" (the "plus" character). The pixels that has become white during the game mustn't be changed. Print them as "w". If there are multiple possible ways to position the frame of the minimum size, print any of them.

If the required frame doesn't exist, then print a single line containing number -1.

Examples

Input

4 8
..w..w..
........
........
..w..w..


Output

..w++w..
..+..+..
..+..+..
..w++w..


Input

5 6
......
.w....
......
..w...
......


Output

......
+w+...
+.+...
++w...
......


Input

2 4
....
.w..


Output

....
.w..


Input

2 6
w..w.w
...w..


Output

-1

Note

In the first sample the required size of the optimal frame equals 4. In the second sample the size of the optimal frame equals 3. In the third sample, the size of the optimal frame is 1. In the fourth sample, the required frame doesn't exist.
#include <bits/stdc++.h>
using namespace std;
template <class T>
int bit_count(T no) {
  int cnt = 0;
  while (no) {
    no = no >> 1;
    cnt++;
  }
  return cnt;
}
void seive(int lm, int arr[]) {
  for (int i = 2; i * i <= lm; i++)
    if (arr[i] == 0)
      for (int j = 1; j * i <= lm; j++) arr[i * j] = 1;
}
template <class T>
void showBit(T N) {
  T zero = 0, one = 1;
  if (N == zero) return;
  showBit(N >> 1);
  printf("%d", N & one);
}
template <class T>
T binToDec(string s) {
  int ln = s.length();
  T sum = 0;
  for (int i = ln - 1, k = 0; i >= 0; i--, k++)
    sum = sum + (s[i] - '0') * (1 << k);
  return sum;
}
void combination(long long com[][1005]) {
  com[0][0] = 1;
  int sz = 1000;
  for (int i = 1; i <= sz; i++) {
    com[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      com[i][j] = com[i - 1][j] + com[i - 1][j - 1];
      com[i][j] = com[i][j] % 1000000007;
    }
  }
}
template <class T>
T bigmod(T bs, T p, T mod) {
  if (mod <= 0) {
    printf("Exception");
    return 0;
  }
  T ans = 1;
  T k = bs;
  while (p) {
    if (p & 1) {
      ans = ans * k;
      ans %= mod;
    }
    k *= k;
    k %= mod;
    p = p >> 1;
  }
  return ans;
}
template <class T>
T gcd(T u, T v) {
  if (v == 0) return u;
  return gcd(v, u % v);
}
void insert_ind(int cs, int ci, int s, int e) {
  if (s == e) {
    return;
  }
  int mid = (s + e) / 2;
  if (ci <= mid)
    insert_ind(2 * cs, ci, s, mid);
  else
    insert_ind(2 * cs + 1, ci, mid + 1, e);
}
void update_ind(int cs, int ci, int s, int e, int val) {
  if (s == e) {
    return;
  }
  int mid = (s + e) / 2;
  if (ci <= mid)
    update_ind(2 * cs, ci, s, mid, val);
  else
    update_ind(2 * cs + 1, ci, mid + 1, e, val);
}
void update_seg(int cs, int ds, int de, int s, int e, int val) {
  if (ds == s && de == e) {
    return;
  }
  int mid = (s + e) / 2;
  if (ds <= mid) update_seg(2 * cs, ds, min(mid, de), s, mid, val);
  if (de > mid) update_seg(2 * cs + 1, max(mid + 1, ds), de, mid + 1, e, val);
}
void pattern_match(char pat[], const int len, int pi[]) {
  pi[0] = 0;
  for (int i = 1; i < len; i++) {
    int ch = pi[i - 1];
    while (pat[ch] != pat[i]) {
      if (ch == 0) {
        ch = -1;
        break;
      }
      ch = pi[ch - 1];
    }
    pi[i] = ch + 1;
  }
}
void pattern_match(char pat[], int pi[], char tar[], const int len1, int gi[]) {
  if (pat[0] == tar[0]) gi[0] = 1;
  for (int i = 1; i < len1; i++) {
    int st = gi[i - 1];
    while (pat[st] != tar[i]) {
      if (st == 0) {
        st = -1;
        break;
      }
      st = pi[st - 1];
    }
    if (st == -1)
      gi[i] = 0;
    else
      gi[i] = st + 1;
  }
}
struct myArray {
  int mat[10][10];
};
myArray matrix_mul(myArray mat1, myArray mat2, const int sz) {
  int tmp[sz][sz];
  memset((tmp), 0, sizeof((tmp)));
  for (int r = 0; r < sz; r++)
    for (int c = 0; c < sz; c++)
      for (int cr = 0; cr < sz; cr++)
        tmp[r][c] += mat1.mat[r][cr] * mat2.mat[cr][c];
  myArray res;
  for (int r = 0; r < sz; r++)
    for (int c = 0; c < sz; c++) res.mat[r][c] = tmp[r][c];
  return res;
}
myArray unit_matrix(const int sz) {
  myArray ma;
  memset((ma.mat), 0, sizeof((ma.mat)));
  for (int i = 0; i < sz; i++) ma.mat[i][i] = 1;
  return ma;
}
myArray matrix_expo(int p, myArray mat, const int sz) {
  if (p == 0) {
    return unit_matrix(sz);
  }
  if (p & 1) return matrix_mul(mat, matrix_expo(p - 1, mat, sz), sz);
  myArray tmp = matrix_expo(p >> 1, mat, sz);
  return matrix_mul(tmp, tmp, sz);
}
map<string, int> msi;
void cal_state(string s, int tran[][30]) {
  int ln = s.length();
  string s1 = s;
  for (int i = 0; i < ln; i++) {
    msi[s1] = ln - i;
    s1 = s1.substr(0, ln - i - 1);
  }
  s1 = "";
  for (int i = 0; i < ln; i++) {
    string ts = s1;
    for (int j = 0; j < 26; j++) {
      s1 = ts + (char)('a' + j);
      int tln = i + 1;
      while (msi[s1] == 0) {
        s1 = s1.substr(1);
        tln--;
        if (tln == 0) break;
      }
      if (tln == 0) s1 = "";
      tran[i][j] = msi[s1];
    }
    s1 = s.substr(0, i + 1);
  }
}
double distance(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int X[] = {0, 0, 1, -1};
int Y[] = {1, -1, 0, 0};
const int dx[8] = {-1, 1, -2, 2, -1, 1, -2, 2};
const int dy[8] = {2, 2, -1, -1, -2, -2, 1, 1};
char grid[2005][2005];
int n, m;
int countW(int sr, int sc, int sz) {
  if (sr + sz > n || sc + sz > m) return -1;
  int cnt = 0, er = sr + sz - 1, ec = sc + sz - 1;
  for (int i = (sc); i < (ec + 1); ++i)
    if (grid[sr][i] == 'w') cnt++;
  for (int i = (sc); i < (ec + 1); ++i)
    if (grid[er][i] == 'w') cnt++;
  for (int i = (sr + 1); i < (er); ++i)
    if (grid[i][sc] == 'w') cnt++;
  for (int i = (sr + 1); i < (er); ++i)
    if (grid[i][ec] == 'w') cnt++;
  return cnt;
}
void print(int sr, int sc, int sz) {
  int er = sr + sz - 1, ec = sc + sz - 1;
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (m); ++j)
      if (grid[i][j] == 'w')
        printf("w");
      else if (i >= sr && i <= er && j == sc)
        printf("+");
      else if (i >= sr && i <= er && j == ec)
        printf("+");
      else if (j >= sc && j <= ec && i == sr)
        printf("+");
      else if (j >= sc && j <= ec && i == er)
        printf("+");
      else
        printf(".");
    printf("\n");
  }
}
int main() {
  scanf("%d%d", &n, &m);
  getchar();
  int lc = 2005, rc = -1, ur = 2005, dr = -1, cnt = 0;
  for (int i = (0); i < (n); ++i) gets(grid[i]);
  for (int i = (0); i < (n); ++i)
    for (int j = (0); j < (m); ++j)
      if (grid[i][j] == 'w') {
        lc = min(lc, j);
        rc = max(rc, j);
        ur = min(ur, i);
        dr = i;
        cnt++;
      }
  if (cnt <= 1) {
    print(-1, -1, -1);
    return 0;
  }
  int sz = max(rc - lc + 1, dr - ur + 1);
  int sr = ur, sc = lc;
  int is = 0;
  if (rc - lc + 1 == sz && dr - ur + 1 == sz) {
    if (countW(ur, lc, sz) == cnt) {
      sc = lc;
      sr = ur;
      is = 1;
    }
  } else if (sz > rc - lc + 1) {
    for (int i = (0); i < (sc + 1); ++i)
      if (countW(sr, i, sz) == cnt) {
        sc = i;
        is = 1;
        break;
      }
  } else if (sz > dr - ur + 1) {
    for (int i = (0); i < (sr + 1); ++i)
      if (countW(i, sc, sz) == cnt) {
        sr = i;
        is = 1;
        break;
      }
  }
  if (!is)
    cout << -1 << endl;
  else
    print(sr, sc, sz);
  return 0;
}
