An African crossword is a rectangular table *n* × *m* in size. Each cell of the table contains exactly one letter. This table (it is also referred to as grid) contains some encrypted word that needs to be decoded.

To solve the crossword you should cross out all repeated letters in rows and columns. In other words, a letter should only be crossed out if and only if the corresponding column or row contains at least one more letter that is exactly the same. Besides, all such letters are crossed out simultaneously.

When all repeated letters have been crossed out, we should write the remaining letters in a string. The letters that occupy a higher position follow before the letters that occupy a lower position. If the letters are located in one row, then the letter to the left goes first. The resulting word is the answer to the problem.

You are suggested to solve an African crossword and print the word encrypted there.
The first line contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 100). Next *n* lines contain *m* lowercase Latin letters each. That is the crossword grid.
none
3 3
cba
bcd
cbc
abcd
5 5
fcofd
ooedo
afaoa
rdcdf
eofsf
codeforces
4 4
usah
usha
hasu
suha
ahhasusu
7 5
aabcd
effgh
iijkk
lmnoo
pqqrs
ttuvw
xxyyz
bcdeghjlmnprsuvwz
10 10
aaaaaaaaaa
bccceeeeee
cdfffffffe
cdfiiiiile
cdfjjjjile
dddddddile
edfkkkkile
edddddddde
gggggggggg
hhhhhhhhhe
b
15 3
jhg
jkn
jui
fth
oij
yuf
yfb
ugd
hgd
oih
hvc
ugg
yvv
tdg
hgf
hkniftjfbctd
17 19
bmzbmweyydiadtlcoue
gmdbyfwurpwbpuvhifn
uapwyndmhtqvkgkbhty
tszotwflegsjzzszfwt
zfpnscguemwrczqxyci
vdqnkypnxnnpmuduhzn
oaquudhavrncwfwujpc
miggjmcmkkbnjfeodxk
gjgwxtrxingiqquhuwq
hdswxxrxuzzfhkplwun
fagppcoildagktgdarv
eusjuqfistulgbglwmf
gzrnyxryetwzhlnfewc
zmnoozlqatugmdjwgzc
fabbkoxyjxkatjmpprs
wkdkobdagwdwxsufees
rvncbszcepigpbzuzoo
lcorviunqvgblgjfsgmrqxyivyxodhvrjpicbneodxjtfkpolvejqmllqadjwotmbgxrvs
1 1
a
a
2 2
zx
xz
zxxz
1 2
fg
fg
2 1
h
j
hj
1 3
iji
j
3 1
k
p
k
p
2 3
mhw
bfq
mhwbfq
3 2
xe
er
wb
xeerwb
3 7
nutuvjg
tgqutfn
yfjeiot
ntvjggqfnyfjeiot
5 4
uzvs
amfz
wypl
xizp
fhmf
uzvsamfzwyplxizphm
8 9
tjqrtgrem
rwjcfuoey
ywrjgpzca
wabzggojv
ajqmmcclh
ozilebskd
qmgnbmtcq
wakptzkjr
mrjcfuyyrjpzabzvalhozilebskdgnbtpzr
9 3
jel
jws
tab
vyo
kgm
pls
abq
bjx
ljt
elwtabvyokgmplabqbxlt
7 6
eklgxi
xmpzgf
xvwcmr
rqssed
ouiqpt
dueiok
bbuorv
eklgximpzgfvwcmrrqedoiqptdeiokuorv
14 27
pzoshpvvjdpmwfoeojapmkxjrnk
itoojpcorxjdxrwyewtmmlhjxhx
doyopbwusgsmephixzcilxpskxh
ygpvepeuxjbnezdrnjfwdhjwjka
rfjlbypoalbtjwrpjxzenmeipfg
khjhrtktcnajrnbefhpavxxfnlx
vwlwumqpfegjgvoezevqsolaqhh
pdrvrtzqsoujqfeitkqgtxwckrl
xtepjflcxcrfomhqimhimnzfxzg
whkfkfvvjwkmwhfgeovwowshyhw
olchgmhiehumivswgtfyhqfagbp
tdudrkttpkryvaiepsijuejqvmq
muratfqqdbfpefmhjzercortroh
wxkebkzchupxumfizftgqvuwgau
zshdanicdyldybwgclygzrhkayatwxznmicbpvlupfsoewcleploqngsyolceswtyqbpyasmuadbpcehqva
1 100
ysijllpanprcrrtvokqmmupuptvawhvnekeybdkzqaduotmkfwybqvytkbjfzyqztmxckizheorvkhtyoohbswcmhknyzlgxordu
g
2 100
gplwoaggwuxzutpwnmxhotbexntzmitmcvnvmuxknwvcrnsagvdojdgaccfbheqojgcqievijxapvepwqolmnjqsbejtnkaifstp
oictcmphxbrylaarcwpruiastazvmfhlcgticvwhpxyiiqokxcjgwlnfykkqdsfmrfaedzchrfzlwdclqjxvidhomhxqnlmuoowg
rbe
3 100
onmhsoxoexfwavmamoecptondioxdjsoxfuqxkjviqnjukwqjwfadnohueaxrkreycicgxpmogijgejxsprwiweyvwembluwwqhj
uofldyjyuhzgmkeurawgsrburovdppzjiyddpzxslhyesvmuwlgdjvzjqqcpubfgxliulyvxxloqyhxspoxvhllbrajlommpghlv
vdohhghjlvihrzmwskxfatoodupmnouwyyfarhihxpdnbwrvrysrpxxptdidpqabwbfnxhiziiiqtozqjtnitgepxjxosspsjldo
blkck
100 1
a
m
n
h
a
x
t
a
o
p
j
z
r
k
q
l
b
r
o
i
y
i
p
i
t
n
d
c
z
p
u
n
w
y
g
s
t
m
z
e
v
g
y
j
d
z
y
a
n
x
k
d
q
n
v
g
k
i
k
f
a
b
w
o
u
w
k
k
b
z
u
i
u
v
g
v
x
g
p
i
z
s
v
q
s
b
w
e
p
k
t
p
d
r
g
d
k
m
f
d
hlc
100 2
hd
gx
mz
bq
of
st
zc
dg
th
ba
ew
bw
oc
ow
vh
qp
in
eh
pj
at
nn
br
ij
co
lv
sa
tb
bl
sr
xa
bz
rp
sz
oi
ec
pw
hf
jm
wu
hq
ra
pv
tc
gv
ik
ux
tz
bf
ty
dk
wo
or
za
kv
qt
fa
jy
bk
uv
gk
cz
ds
ie
oq
mf
xn
ql
xs
fb
iv
cj
kn
ns
lg
ji
ha
aj
dg
fj
ut
sg
ju
oc
ov
he
nw
bl
lp
bx
nm
yq
cw
ov
xk
pg
oh
pl
uo
gf
ul
dvy
100 3
ruy
mye
jgp
scn
ktq
alx
mvk
lpm
kry
orb
mpu
zcv
lge
kft
dzp
tfb
hqz
uur
hry
zjx
cuo
qqc
tih
enj
vnp
bwi
zzh
hkc
wdr
ldh
vel
izj
fhb
qrn
qpp
vzs
lhg
kee
lbq
zhy
wcl
yaa
ton
fly
kyw
ept
gwq
coe
opd
eez
nmx
njg
why
vel
afq
nbq
ulx
oxs
bbo
yhx
fmz
nrg
nfm
jek
beu
tya
xgs
sgg
nkq
bbv
wkd
tns
fdt
eox
obc
eab
kkj
oub
gji
rht
ozv
ysk
sbt
flf
pbu
lxb
pzs
rzh
cea
kmi
uea
ncc
zng
vkn
jhn
jqw
lqc
mbt
lov
gam
tvdiixs
n, m = map(int, input().split())
grid = []
for _ in range(n):
    grid.append(list(input()))

for i in range(n):
    for j in range(m):
        if grid[i][j] == '*':
            continue
        for k in range(j+1, m):
            if grid[i][j] == grid[i][k]:
                grid[i][k] = '*'

for j in range(m):
    for i in range(n):
        if grid[i][j] == '*':
            continue
        for k in range(i+1, n):
            if grid[i][j] == grid[k][j]:
                grid[k][j] = '*'

result = ''
for i in range(n):
    for j in range(m):
        if grid[i][j] != '*':
            result += grid[i][j]

print(result)
