1 2
fg
 3 2
xe
er
wb
 7 6
eklgxi
xmpzgf
xvwcmr
rqssed
ouiqpt
dueiok
bbuorv
 9 3
jel
jws
tab
vyo
kgm
pls
abq
bjx
ljt
 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
 2 2
zx
xz
 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
 3 1
k
p
k
 5 4
uzvs
amfz
wypl
xizp
fhmf
 3 100
onmhsoxoexfwavmamoecptondioxdjsoxfuqxkjviqnjukwqjwfadnohueaxrkreycicgxpmogijgejxsprwiweyvwembluwwqhj
uofldyjyuhzgmkeurawgsrburovdppzjiyddpzxslhyesvmuwlgdjvzjqqcpubfgxliulyvxxloqyhxspoxvhllbrajlommpghlv
vdohhghjlvihrzmwskxfatoodupmnouwyyfarhihxpdnbwrvrysrpxxptdidpqabwbfnxhiziiiqtozqjtnitgepxjxosspsjldo
 2 100
gplwoaggwuxzutpwnmxhotbexntzmitmcvnvmuxknwvcrnsagvdojdgaccfbheqojgcqievijxapvepwqolmnjqsbejtnkaifstp
oictcmphxbrylaarcwpruiastazvmfhlcgticvwhpxyiiqokxcjgwlnfykkqdsfmrfaedzchrfzlwdclqjxvidhomhxqnlmuoowg
 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
 3 7
nutuvjg
tgqutfn
yfjeiot
 10 10
aaaaaaaaaa
bccceeeeee
cdfffffffe
cdfiiiiile
cdfjjjjile
dddddddile
edfkkkkile
edddddddde
gggggggggg
hhhhhhhhhe
 2 1
h
j
 17 19
bmzbmweyydiadtlcoue
gmdbyfwurpwbpuvhifn
uapwyndmhtqvkgkbhty
tszotwflegsjzzszfwt
zfpnscguemwrczqxyci
vdqnkypnxnnpmuduhzn
oaquudhavrncwfwujpc
miggjmcmkkbnjfeodxk
gjgwxtrxingiqquhuwq
hdswxxrxuzzfhkplwun
fagppcoildagktgdarv
eusjuqfistulgbglwmf
gzrnyxryetwzhlnfewc
zmnoozlqatugmdjwgzc
fabbkoxyjxkatjmpprs
wkdkobdagwdwxsufees
rvncbszcepigpbzuzoo
 7 5
aabcd
effgh
iijkk
lmnoo
pqqrs
ttuvw
xxyyz
 1 3
iji
 1 100
ysijllpanprcrrtvokqmmupuptvawhvnekeybdkzqaduotmkfwybqvytkbjfzyqztmxckizheorvkhtyoohbswcmhknyzlgxordu
 1 1
a
 15 3
jhg
jkn
jui
fth
oij
yuf
yfb
ugd
hgd
oih
hvc
ugg
yvv
tdg
hgf
 8 9
tjqrtgrem
rwjcfuoey
ywrjgpzca
wabzggojv
ajqmmcclh
ozilebskd
qmgnbmtcq
wakptzkjr
 4 4
usah
usha
hasu
suha
 2 3
mhw
bfq
 14 27
pzoshpvvjdpmwfoeojapmkxjrnk
itoojpcorxjdxrwyewtmmlhjxhx
doyopbwusgsmephixzcilxpskxh
ygpvepeuxjbnezdrnjfwdhjwjka
rfjlbypoalbtjwrpjxzenmeipfg
khjhrtktcnajrnbefhpavxxfnlx
vwlwumqpfegjgvoezevqsolaqhh
pdrvrtzqsoujqfeitkqgtxwckrl
xtepjflcxcrfomhqimhimnzfxzg
whkfkfvvjwkmwhfgeovwowshyhw
olchgmhiehumivswgtfyhqfagbp
tdudrkttpkryvaiepsijuejqvmq
muratfqqdbfpefmhjzercortroh
wxkebkzchupxumfizftgqvuwgau

fg
 xeerwb
 eklgximpzgfvwcmrrqedoiqptdeiokuorv
 elwtabvyokgmplabqbxlt
 dvy
 zxxz
 tvdiixs
 p
 uzvsamfzwyplxizphm
 blkck
 rbe
 hlc
 ntvjggqfnyfjeiot
 b
 hj
 lcorviunqvgblgjfsgmrqxyivyxodhvrjpicbneodxjtfkpolvejqmllqadjwotmbgxrvs
 bcdeghjlmnprsuvwz
 j
 g
 a
 hkniftjfbctd
 mrjcfuyyrjpzabzvalhozilebskdgnbtpzr
 ahhasusu
 mhwbfq
 zshdanicdyldybwgclygzrhkayatwxznmicbpvlupfsoewcleploqngsyolceswtyqbpyasmuadbpcehqva

n,m = map(int, input().split(' '))

grid = []
for _ in range(n):
  grid.append(list(input()))

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

print(res)
