A boy Bob likes to draw. Not long ago he bought a rectangular graph (checked) sheet with n rows and m columns. Bob shaded some of the squares on the sheet. Having seen his masterpiece, he decided to share it with his elder brother, who lives in Flatland. Now Bob has to send his picture by post, but because of the world economic crisis and high oil prices, he wants to send his creation, but to spend as little money as possible. For each sent square of paper (no matter whether it is shaded or not) Bob has to pay 3.14 burles. Please, help Bob cut out of his masterpiece a rectangle of the minimum cost, that will contain all the shaded squares. The rectangle's sides should be parallel to the sheet's sides.

Input

The first line of the input data contains numbers n and m (1 ≤ n, m ≤ 50), n — amount of lines, and m — amount of columns on Bob's sheet. The following n lines contain m characters each. Character «.» stands for a non-shaded square on the sheet, and «*» — for a shaded square. It is guaranteed that Bob has shaded at least one square.

Output

Output the required rectangle of the minimum cost. Study the output data in the sample tests to understand the output format better.

Examples

Input

6 7
.......
..***..
..*....
..***..
..*....
..***..


Output

***
*..
***
*..
***


Input

3 3
***
*.*
***


Output

***
*.*
***
def getInput():
       #n and m are the sizes of board
       n,m =map(int,input().strip().split())
       #get input board
       board = []
       for _ in range(n):
              #store each char on its index
              board.append(list([char for char in input()]))
       return board
def removeUnnecessaryFields(board):
       #iterate over boards from top until met a *
       row = -1
       #set to be deleted as True
       delete = True
       while row < len(board) and delete:
              row += 1
              #iterate over each char
              for char in board[row]:
                     #if we met a *
                     if char == '*':
                            #this row shouldn't be deleted
                            delete = False
                            #don't look forword, because we don't want to split our drawing in 2
                            break
              #if deleted is true, than we have only ....
              if delete:
                     #we remove the row
                     del(board[row])
                     #but we want to remain on the same position
                     row -= 1
       #do all the steps above, but for bottom-top direction
       row = len(board)
       delete = True
       while row > 0 and delete:
              row -= 1
              for char in board[row]:
                     if char == '*':
                            delete = False
                            break
              if delete:
                     del(board[row])

              
       return board
def main():
       board = getInput()
       partiallyCleanedBoard = removeUnnecessaryFields(board)
       #change columns with rows
       reversedBoard = list(map(list, zip(*partiallyCleanedBoard)))
       #remove unnecessary columns
       cleanedBoard = removeUnnecessaryFields(reversedBoard)
       #undo the above reverse operation
       undoReversedBoard = list(map(list, zip(*cleanedBoard)))
       #print the result
       for resultLetter in undoReversedBoard:
              print(''.join(resultLetter))
main()