Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(n_h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Fixed submission:
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(n_h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
for b in range(h):
    print("".join(lst[b]))

Fixed submission:
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy python submission (verdict: Runtime Error):
import numpy as np
h,w=map(int,input().split())
lst=list(list(input()) for i in range(h))
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        lst.pop(h-i-1)
lst=np.array(lst)
lst=np.rot90(lst,k=-1).tolist()
for i in range(len(lst)):
    if "#" not in lst[w-i-1]:
        lst.pop(w-i-1)
lst=np.array(lst)
lst=np.rot90(lst,k=1).tolist()
for b in range(h):
    print("".join(lst[b]))

Fixed submission:
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy python submission (verdict: Runtime Error):
import numpy
h,w=map(int,input().split())
lst=list(input() for i in range(h))
for a in lst:
    if a=="."*w:
        h-=1
        lst.remove(a)
lst=numpy.rot90(lst,k=1)
for a in lst:
    if a=="."*h:
        lst.remove(a)
lst=numpy.rot90(lst,k=-1)
for b in range(h):
    print(lst[b])


Fixed submission:
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
for a in lst:
    if a=="."*w:
        h-=1
        lst.remove(a)
lst=list(map(list,lst))
for i in range(w):
    T=True
    if i>w:
        break
    for b in range(h):
        if lst[b][i]!="." :
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(i)
        w-=1
for b in range(h):
    print("".join(lst[b]))

Fixed submission:
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
for a in lst:
    if a=="."*w:
        h-=1
        lst.remove(a)
for i in range(w):
    T=True
    if i>w:
        break
    for b in range(h):
        if lst[b][i]!="." :
            T=False
            break
    if T==True:
        for b in range(h):
            lst[b]="".join(list(lst[b]).pop(i))
            w-=1
for b in range(h):
    print(lst[b])

Fixed submission:
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))