First-rate specialists graduate from Berland State Institute of Peace and Friendship. You are one of the most talented students in this university. The education is not easy because you need to have fundamental knowledge in different areas, which sometimes are not related to each other. 

For example, you should know linguistics very well. You learn a structure of Reberland language as foreign language. In this language words are constructed according to the following rules. First you need to choose the "root" of the word — some string which has more than 4 letters. Then several strings with the length 2 or 3 symbols are appended to this word. The only restriction —  it is not allowed to append the same string twice in a row. All these strings are considered to be suffixes of the word (this time we use word "suffix" to describe a morpheme but not the few last characters of the string as you may used to). 

Here is one exercise that you have found in your task list. You are given the word *s*. Find all distinct strings with the length 2 or 3, which can be suffixes of this word according to the word constructing rules in Reberland language. 

Two strings are considered distinct if they have different length or there is a position in which corresponding characters do not match. 

Let's look at the example: the word *abacabaca* is given. This word can be obtained in the following ways: <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/c46b5ea573cf4d0d3338e62f90468385ccc9b598.png" style="max-width: 100.0%;max-height: 100.0%;"/>, where the root of the word is overlined, and suffixes are marked by "corners". Thus, the set of possible suffixes for this word is {*aca*, *ba*, *ca*}.
The only line contains a string *s* (5 ≤ |*s*| ≤ 10<sup class="upper-index">4</sup>) consisting of lowercase English letters.
The first test was analysed in the problem statement. 

In the second example the length of the string equals 5. The length of the root equals 5, so no string can be used as a suffix.
abacabaca
3
aca
ba
ca
abaca
0
gzqgchv
1
hv
iosdwvzerqfi
9
er
erq
fi
qfi
rq
vz
vze
ze
zer
oawtxikrpvfuzugjweki
25
eki
fu
fuz
gj
gjw
ik
ikr
jw
jwe
ki
kr
krp
pv
pvf
rp
rpv
ug
ugj
uz
uzu
vf
vfu
we
zu
zug
abcdexyzzzz
5
xyz
yz
yzz
zz
zzz
affviytdmexpwfqplpyrlniprbdphrcwlboacoqec
67
ac
aco
bd
bdp
bo
boa
co
coq
cw
cwl
dm
dme
dp
dph
ec
ex
exp
fq
fqp
hr
hrc
ip
ipr
lb
lbo
ln
lni
lp
lpy
me
mex
ni
nip
oa
oac
oq
ph
phr
pl
plp
pr
prb
pw
pwf
py
pyr
qec
qp
qpl
rb
rbd
rc
rcw
rl
rln
td
tdm
wf
wfq
wl
wlb
xp
xpw
yr
yrl
yt
ytd
lmnxtobrknqjvnzwadpccrlvisxyqbxxmghvl
59
ad
adp
br
brk
bx
bxx
cc
ccr
cr
crl
dp
dpc
gh
hvl
is
isx
jv
jvn
kn
knq
lv
lvi
mg
mgh
nq
nqj
nz
nzw
ob
obr
pc
pcc
qb
qbx
qj
qjv
rk
rkn
rl
rlv
sx
sxy
vi
vis
vl
vn
vnz
wa
wad
xm
xmg
xx
xxm
xy
xyq
yq
yqb
zw
zwa
tbdbdpkluawodlrwldjgplbiylrhuywkhafbkiuoppzsjxwbaqqiwagprqtoauowtaexrhbmctcxwpmplkyjnpwukzwqrqpv
170
ae
aex
af
afb
ag
agp
aq
aqq
au
auo
aw
awo
ba
baq
bi
biy
bk
bki
bm
bmc
ct
ctc
cx
cxw
dj
djg
dl
dlr
ex
exr
fb
fbk
gp
gpl
gpr
ha
haf
hb
hbm
hu
huy
iu
iuo
iw
iwa
iy
iyl
jg
jgp
jn
jnp
jx
jxw
kh
kha
ki
kiu
kl
klu
ky
kyj
kz
kzw
lb
lbi
ld
ldj
lk
lky
lr
lrh
lrw
lu
lua
mc
mct
mp
mpl
np
npw
oa
oau
od
odl
op
opp
ow
owt
pk
pkl
pl
plb
plk
pm
pmp
pp
ppz
pr
prq
pv
pw
pwu
pz
pzs
qi
qiw
qpv
qq
qqi
qr
qrq
qt
q...
caqmjjtwmqxytcsawfufvlofqcqdwnyvywvbbhmpzqwqqxieptiaguwvqdrdftccsglgfezrzhstjcxdknftpyslyqdmkwdolwbusyrgyndqllgesktvgarpfkiglxgtcfepclqhgfbfmkymsszrtynlxbosmrvntsqwccdtahkpnelwiqn
323
ag
agu
ah
ahk
ar
arp
aw
awf
bb
bbh
bf
bfm
bh
bhm
bo
bos
bu
bus
cc
ccd
ccs
cd
cdt
cf
cfe
cl
clq
cq
cqd
cs
csa
csg
cx
cxd
df
dft
dk
dkn
dm
dmk
do
dol
dq
dql
dr
drd
dt
dta
dw
dwn
el
elw
ep
epc
ept
es
esk
ez
ezr
fb
fbf
fe
fep
fez
fk
fki
fm
fmk
fq
fqc
ft
ftc
ftp
fu
fuf
fv
fvl
ga
gar
ge
ges
gf
gfb
gfe
gl
glg
glx
gt
gtc
gu
guw
gy
gyn
hg
hgf
hk
hkp
hm
hmp
hs
hst
ia
iag
ie
iep
ig
igl
iqn
jc
jcx
jt
jtw...
prntaxhysjfcfmrjngdsitlguahtpnwgbaxptubgpwcfxqehrulbxfcjssgocqncscduvyvarvwxzvmjoatnqfsvsilubexmwugedtzavyamqjqtkxzuslielibjnvkpvyrbndehsqcaqzcrmomqqwskwcypgqoawxdutnxmeivnfpzwvxiyscbfnloqjhjacsfnkfmbhgzpujrqdbaemjsqphokkiplblbflvadcyykcqrdohfasstobwrobslaofbasylwiizrpozvhtwyxtzl
505
ac
acs
ad
adc
ae
aem
ah
aht
am
amq
ao
aof
aq
aqz
ar
arv
as
ass
asy
at
atn
av
avy
aw
awx
ax
axp
ba
bae
bas
bax
be
bex
bf
bfl
bfn
bg
bgp
bh
bhg
bj
bjn
bl
blb
bn
bnd
bs
bsl
bw
bwr
bx
bxf
ca
caq
cb
cbf
cd
cdu
cf
cfm
cfx
cj
cjs
cq
cqn
cqr
cr
crm
cs
csc
csf
cy
cyp
cyy
db
dba
dc
dcy
de
deh
do
doh
ds
dsi
dt
dtz
du
dut
duv
ed
edt
eh
ehr
ehs
ei
eiv
el
eli
em
emj
ex
exm
fa
fas
fb
fba
fc
fcf
fcj
fl
flv
f...
gvtgnjyfvnuhagulgmjlqzpvxsygmikofsnvkuplnkxeibnicygpvfvtebppadpdnrxjodxdhxqceaulbfxogwrigstsjudhkgwkhseuwngbppisuzvhzzxxbaggfngmevksbrntpprxvcczlalutdzhwmzbalkqmykmodacjrmwhwugyhwlrbnqxsznldmaxpndwmovcolowxhj
375
ac
acj
ad
adp
ag
agg
agu
al
alk
alu
au
aul
ax
axp
ba
bag
bal
bf
bfx
bn
bni
bnq
bp
bpp
br
brn
cc
ccz
ce
cea
cj
cjr
co
col
cy
cyg
cz
czl
da
dac
dh
dhk
dhx
dm
dma
dn
dnr
dp
dpd
dw
dwm
dx
dxd
dz
dzh
ea
eau
eb
ebp
ei
eib
eu
euw
ev
evk
fn
fng
fs
fsn
fv
fvn
fvt
fx
fxo
gb
gbp
gf
gfn
gg
ggf
gm
gme
gmi
gmj
gp
gpv
gs
gst
gu
gul
gw
gwk
gwr
gy
gyh
ha
hag
hj
hk
hkg
hs
hse
hw
hwl
hwm
hwu
hx
hxq
hz
hzz
ib
ib...
topqexoicgzjmssuxnswdhpwbsqwfhhziwqibjgeepcvouhjezlomobgireaxaceppoxfxvkwlvgwtjoiplihbpsdhczddwfvcbxqqmqtveaunshmobdlkmmfyajjlkhxnvfmibtbbqswrhcfwytrccgtnlztkddrevkfovunuxtzhhhnorecyfgmlqcwjfjtqegxagfiuqtpjpqlwiefofpatxuqxvikyynncsueynmigieototnbcwxavlbgeqao
462
ac
ace
ag
agf
aj
ajj
ao
at
atx
au
aun
av
avl
ax
axa
bb
bbq
bc
bcw
bd
bdl
bg
bge
bgi
bj
bjg
bp
bps
bq
bqs
bs
bsq
bt
btb
bx
bxq
cb
cbx
cc
ccg
ce
cep
cf
cfw
cg
cgt
cgz
cs
csu
cv
cvo
cw
cwj
cwx
cy
cyf
cz
czd
dd
ddr
ddw
dh
dhc
dhp
dl
dlk
dr
dre
dw
dwf
ea
eau
eax
ec
ecy
ee
eep
ef
efo
eg
egx
eo
eot
ep
epc
epp
eq
ev
evk
ey
eyn
ez
ezl
fg
fgm
fh
fhh
fi
fiu
fj
fjt
fm
fmi
fo
fof
fov
fp
fpa
fv
fvc
fw
fwy
...
lcrjhbybgamwetyrppxmvvxiyufdkcotwhmptefkqxjhrknjdponulsynpkgszhbkeinpnjdonjfwzbsaweqwlsvuijauwezfydktfljxgclpxpknhygdqyiapvzudyyqomgnsrdhhxhsrdfrwnxdolkmwmw
276
am
amw
ap
apv
au
auw
aw
awe
bg
bga
bk
bke
bs
bsa
by
byb
cl
clp
co
cot
df
dfr
dh
dhh
dk
dkc
dkt
do
dol
don
dp
dpo
dq
dqy
dy
dyy
ef
efk
ei
ein
eq
eqw
et
ety
ez
ezf
fd
fdk
fk
fkq
fl
flj
fr
frw
fw
fwz
fy
fyd
ga
gam
gc
gcl
gd
gdq
gn
gns
gs
gsz
hb
hbk
hh
hhx
hm
hmp
hr
hrk
hs
hsr
hx
hxh
hy
hyg
ia
iap
ij
ija
in
inp
iy
iyu
ja
jau
jd
jdo
jdp
jf
jfw
jh
jhr
jx
jxg
kc
kco
ke
kei
kg
kgs
km
kmw
kn
knh
knj
...
hzobjysjhbebobkoror
20
be
beb
bko
bo
bob
eb
ebo
hb
hbe
jh
jhb
ko
kor
ob
or
ror
sj
sjh
ys
ysj
safgmgpzljarfswowdxqhuhypxcmiddyvehjtnlflzknznrukdsbatxoytzxkqngopeipbythhbhfkvlcdxwqrxumbtbgiosjnbeorkzsrfarqofsrcwsfpyheaszjpkjysrcxbzebkxzovdchhososo
274
ar
arf
arq
as
asz
at
atx
ba
bat
be
beo
bg
bgi
bh
bhf
bk
bkx
bt
btb
by
byt
bz
bze
cd
cdx
ch
chh
cm
cmi
cw
cws
cx
cxb
dc
dch
dd
ddy
ds
dsb
dx
dxq
dxw
dy
dyv
ea
eas
eb
ebk
eh
ehj
ei
eip
eo
eor
fa
far
fk
fkv
fl
flz
fp
fpy
fs
fsr
fsw
gi
gio
go
gop
gp
gpz
hb
hbh
he
hea
hf
hfk
hh
hhb
hj
hjt
hos
hu
huh
hy
hyp
id
idd
io
ios
ip
ipb
ja
jar
jn
jnb
jp
jpk
jt
jtn
jy
jys
kd
kds
kj
kjy
kn
knz
kq
kqn
kv
kvl
...
glaoyryxrgsysy
10
gs
gsy
rgs
ry
ryx
sy
xr
ysy
yx
yxr
aaaaaxyxxxx
5
xx
xxx
xyx
yx
yxx
aaaaax
0
aaaaaxx
1
xx
aaaaaaa
1
aa
aaaaaxxx
2
xx
xxx
aaaaayxx
2
xx
yxx
aaaaaxyz
2
xyz
yz
aaaaaxyxy
2
xy
yxy
aaaxyyxyy
3
xyy
yx
yy
aaaaaxxxxxx
2
xx
xxx
aaaaaxxxxx
2
xx
xxx
aaaaaxyzxyxy
5
xy
yxy
yzx
zx
zxy
aaaaadddgggg
6
dd
ddg
dg
dgg
gg
ggg
abcdeabzzzzzzzz
5
ab
abz
bz
zz
zzz
bbbbbccaaaaaa
4
aa
aaa
ca
cca
xxxxxababc
5
ab
aba
abc
ba
bc
dddddaabbbbbb
4
aab
ab
bb
bbb
xxxxxababe
5
ab
aba
abe
ba
be
aaaaababaaaaaaaaaaaa
6
aa
aaa
ab
ba
baa
bab
from math import *
from sys import *

def cmp1(a):
    for i in range(3):
        if s[a-i-1]!=s[a+i]:
            return 1
    return 0

def cmp2(a):
    for i in range(2):
        if s[a-i-1]!=s[a+i]:
            return 1
    return 0

s=input()
if len(s)>15:
    r=set()
    for i in range(5,len(s)-6):
        r.add(s[i]+s[i+1])
    if s[-4]+s[-3] != s[-2]+s[-1]:
        r.add(s[-6]+s[-5])
    r.add(s[-5]+s[-4])
    r.add(s[-4]+s[-3])
    r.add(s[-2]+s[-1])
    for i in range(5,len(s)-7):
        r.add(s[i]+s[i+1]+s[i+2])
    if s[-4]+s[-3] != s[-2]+s[-1]:
        r.add(s[-7]+s[-6]+s[-5])
    r.add(s[-6]+s[-5]+s[-4])
    r.add(s[-5]+s[-4]+s[-3])
    r.add(s[-3]+s[-2]+s[-1])
    ans=[]
    for i in r:
        ans.append(i)
else:
    st=set()
    st.add((len(s),0))
    suf=set()
    while st:
        a=st.pop()
        if a[0]>=8 and (a[1]!=3 or cmp1(a[0])):
            suf.add(s[a[0]-3]+s[a[0]-2]+s[a[0]-1])
            st.add((a[0]-3,3))
        if a[0]>=7 and (a[1]!=2 or cmp2(a[0])):
            suf.add(s[a[0]-2]+s[a[0]-1])
            st.add((a[0]-2,2))
    ans=[]
    for i in suf:
        ans.append(i)
ans.sort()
print(len(ans))
for i in ans:
    print(i)