Buggy python submission (verdict: Runtime Error):
#わからないのでギブアップコピペ
h,w=map(int,input().split())

a=[] #入力データのリスト化
for i in range(h):
  x=input().split()
  a.append(x)

h1=[]
for i in range(h):
  if a[i]==['.']*w:
    h1.append(i)

w1=[]
for i in range(w):
  flag=0
  for j in range(h):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w1.append(i)

ans=[]
for i in range(h):
  if i not in h1:
    r=[]
    for j in range(w):
      r.append(a[i][j])
    ans.append(r)

for i in range(lens(ans)):
  print(''.join(ans[i]))

Fixed submission:
#全然わからず完コピ
H,W=map(int,input().split())
a=[list(input()) for _ in range(H)]
h=[]
for i in range(H):
  if a[i]==['.']*W:
    h.append(i)

w=[]
for i in range(W):
  flag=0
  for j in range(H):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)
  
ans=[]
for i in range(H):
  if i not in h:
    r=[]
    for j in range(W):
      if j not in w:
        r.append(a[i][j])
    ans.append(r)

for i in range(len(ans)):
  print("".join(ans[i]))

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())

a=[] #入力データのリスト化
for i in range(h):
  x=input().split()
  a.append(x)

h1=[]
for i in range(h):
  if a[i]==['.']*w:
    h1.append(i)

w1=[]
for i in range(w):
  flag=0
  for j in range(h):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)

ans=[]
for i in range(h):
  if i not in h1:
    r=[]
    for j in range(w):
      r.append(a[i][j])
    ans.append(r)

for i in range(lens(ans)):
  print(''.join(ans[i]))

Fixed submission:
#全然わからず完コピ
H,W=map(int,input().split())
a=[list(input()) for _ in range(H)]
h=[]
for i in range(H):
  if a[i]==['.']*W:
    h.append(i)

w=[]
for i in range(W):
  flag=0
  for j in range(H):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)
  
ans=[]
for i in range(H):
  if i not in h:
    r=[]
    for j in range(W):
      if j not in w:
        r.append(a[i][j])
    ans.append(r)

for i in range(len(ans)):
  print("".join(ans[i]))

Buggy python submission (verdict: Runtime Error):
#わからないのでギブアップコピペ
h,w=map(int,input().split())

a=[] #入力データのリスト化
for i in range(h):
  x=input().split()
  a.append(x)

h1=[]
for i in range(H):
  if a[i]==['.']*w:
    h1.append(i)

w1=[]
for i in range(w):
  flag=0
  for j in range(h):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)

ans=[]
for i in range(h):
  if i not in h1:
    r=[]
    for j in range(w):
      r.append(a[i][j])
    ans.append(r)

for i in range(lens(ans)):
  print(''.join(ans[i]))


Fixed submission:
#全然わからず完コピ
H,W=map(int,input().split())
a=[list(input()) for _ in range(H)]
h=[]
for i in range(H):
  if a[i]==['.']*W:
    h.append(i)

w=[]
for i in range(W):
  flag=0
  for j in range(H):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)
  
ans=[]
for i in range(H):
  if i not in h:
    r=[]
    for j in range(W):
      if j not in w:
        r.append(a[i][j])
    ans.append(r)

for i in range(len(ans)):
  print("".join(ans[i]))

Buggy python submission (verdict: Runtime Error):
#わからないのでギブアップコピペ
h,w=map(int,input().split())

a=[] #入力データのリスト化
for i in range(h):
  x=input().split()
  a.append(x)

h1=[]
for i in range(H):
  if a[i]==['.']*w
    h1.append(i)

w1=[]
for i in range(w):
  flag=0
  for j in range(h):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)

ans=[]
for i in range(h):
  if i not in h1:
    r=[]
    for j in range(w):
      r.append(a[i][j])
    ans.append(r)

for i in range(lens(ans)):
  print(''.join(ans[i]))

Fixed submission:
#全然わからず完コピ
H,W=map(int,input().split())
a=[list(input()) for _ in range(H)]
h=[]
for i in range(H):
  if a[i]==['.']*W:
    h.append(i)

w=[]
for i in range(W):
  flag=0
  for j in range(H):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)
  
ans=[]
for i in range(H):
  if i not in h:
    r=[]
    for j in range(W):
      if j not in w:
        r.append(a[i][j])
    ans.append(r)

for i in range(len(ans)):
  print("".join(ans[i]))

Buggy python submission (verdict: Runtime Error):
#わからないのでギブアップ・コピペ

h,w=map(int,input().split())

a=[] #入力データのリスト化
for i in range(h):
  x=input().split()
  a.append(x)

h1=[]
for i in range(h):
  if a[i]==['.']:
    h1.append(i)

w1=[]
for i in range(w):
  flag=0
  for j in range(h):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)

ans=[]
for i in range(h):
  if i not in h1:
    r=[]
    for j in range(w):
      r.append(a[i][j])
    ans.append(r)

for i in range(lens(ans)):
  print(''.join(ans[i]))

Fixed submission:
#全然わからず完コピ
H,W=map(int,input().split())
a=[list(input()) for _ in range(H)]
h=[]
for i in range(H):
  if a[i]==['.']*W:
    h.append(i)

w=[]
for i in range(W):
  flag=0
  for j in range(H):
    if a[j][i]=='#':
      flag=1
      break
  if flag==0:
    w.append(i)
  
ans=[]
for i in range(H):
  if i not in h:
    r=[]
    for j in range(W):
      if j not in w:
        r.append(a[i][j])
    ans.append(r)

for i in range(len(ans)):
  print("".join(ans[i]))