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

***
*.*
***
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Scanner;
import java.util.TreeSet;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class _p000014A {
    static public void main(final String[] args) throws IOException {
        p000014A._main(args);
    }
//begin p000014A.java
static private class p000014A extends Solver{public p000014A(){nameIn="p000014A.in"
;singleTest=true;}int n;int m;String[]s;@Override protected void solve(){int r0=
-1;TreeSet<Integer>set=new TreeSet<>();for(int i=0;i<n;i++){set.clear();set.addAll
(s[i].chars().mapToObj(Integer::valueOf).collect(Collectors.toList()));if(set.size
()>1||set.pollFirst()=='*'){r0=i;break;}}int r1=-1;for(int i=n-1;i>=0;i--){set.clear
();set.addAll(s[i].chars().mapToObj(Integer::valueOf).collect(Collectors.toList(
)));if(set.size()>1||set.pollFirst()=='*'){r1=i;break;}}int c0=-1;for(int i=0;i<
m;i++){int i1=i;set.clear();set.addAll(IntStream.range(0,n).map(j->(int)s[j].charAt
(i1)).mapToObj(Integer::valueOf).collect(Collectors.toList()));if(set.size()>1||
set.pollFirst()=='*'){c0=i;break;}}int c1=-1;for(int i=m-1;i>=0;i--){int i1=i;set
.clear();set.addAll(IntStream.range(0,n).map(j->(int)s[j].charAt(i1)).mapToObj(Integer
::valueOf).collect(Collectors.toList()));if(set.size()>1||set.pollFirst()=='*'){
c1=i;break;}}for(int i=r0;i<=r1;i++){pw.println(s[i].substring(c0,c1+1));}}@Override
public void readInput()throws IOException{n=sc.nextInt();m=sc.nextInt();if(sc.hasNextLine
()){sc.nextLine();}s=new String[n];for(int _is=0;_is<n;_is++){s[_is]=sc.nextLine
().trim();}}static public void _main(String[]args)throws IOException{new p000014A
().run();}}
//end p000014A.java
//begin net/leksi/contest/Solver.java
static private abstract class Solver{protected String nameIn=null;protected String
nameOut=null;protected boolean singleTest=false;protected boolean preprocessDebug
=false;protected boolean doNotPreprocess=false;protected Scanner sc=null;protected
PrintWriter pw=null;private void process()throws IOException{if(!singleTest){int
t=lineToIntArray()[0];while(t-->0){readInput();solve();}}else{readInput();solve(
);}}abstract protected void readInput()throws IOException;abstract protected void
solve()throws IOException;protected int[]lineToIntArray()throws IOException{return
Arrays.stream(sc.nextLine().trim().split("\\s+")).mapToInt(Integer::valueOf).toArray
();}protected long[]lineToLongArray()throws IOException{return Arrays.stream(sc.nextLine
().trim().split("\\s+")).mapToLong(Long::valueOf).toArray();}protected String joinToString
(final int[]a){return Arrays.stream(a).mapToObj(Integer::toString).collect(Collectors
.joining(" "));}protected String joinToString(final long[]a){return Arrays.stream
(a).mapToObj(Long::toString).collect(Collectors.joining(" "));}protected<T>String
joinToString(final T[]a){return Arrays.stream(a).map(v->v.toString()).collect(Collectors
.joining(" "));}protected<T>String joinToString(final T[]a,final Function<T,String>
toString){return Arrays.stream(a).map(v->v.toString()).collect(Collectors.joining
(" "));}protected<T>String joinToString(final Collection<T>a){return a.stream().map
(v->v.toString()).collect(Collectors.joining(" "));}protected<T>String joinToString
(final Collection<T>a,final Function<T,String>toString){return a.stream().map(v->
toString.apply(v)).collect(Collectors.joining(" "));}protected List<Long>intArrayToLongList
(final int[]a){return Arrays.stream(a).mapToObj(Long::valueOf).collect(Collectors
.toList());}protected List<Integer>toList(final int[]a){return Arrays.stream(a).mapToObj
(Integer::valueOf).collect(Collectors.toList());}protected List<Long>toList(final
long[]a){return Arrays.stream(a).mapToObj(Long::valueOf).collect(Collectors.toList
());}protected void run()throws IOException{boolean done=false;if(nameIn !=null)
{try{try(FileInputStream fis=new FileInputStream(nameIn);PrintWriter pw0=select_output
();){done=true;sc=new Scanner(fis);pw=pw0;process();}}catch(IOException ex){}}if
(!done){try(PrintWriter pw0=select_output();){sc=new Scanner(System.in);pw=pw0;process
();}}}private PrintWriter select_output()throws FileNotFoundException{if(nameOut
!=null){return new PrintWriter(nameOut);}return new PrintWriter(System.out);}}
//end net/leksi/contest/Solver.java
}
