88_B. Keyboard_9730
Vasya learns to type. He has an unusual keyboard at his disposal: it is rectangular and it has n rows of keys containing m keys in each row. Besides, the keys are of two types. Some of the keys have lowercase Latin letters on them and some of the keys work like the "Shift" key on standard keyboards, that is, they make lowercase letters uppercase.

Vasya can press one or two keys with one hand. However, he can only press two keys if the Euclidean distance between the centers of the keys does not exceed x. The keys are considered as squares with a side equal to 1. There are no empty spaces between neighbouring keys.

Vasya is a very lazy boy, that's why he tries to type with one hand as he eats chips with his other one. However, it is possible that some symbol can't be typed with one hand only, because the distance between it and the closest "Shift" key is strictly larger than x. In this case he will have to use his other hand. Having typed the symbol, Vasya returns other hand back to the chips.

You are given Vasya's keyboard and the text. Count the minimum number of times Vasya will have to use the other hand.

Input

The first line contains three integers n, m, x (1 ≤ n, m ≤ 30, 1 ≤ x ≤ 50).

Next n lines contain descriptions of all the keyboard keys. Each line contains the descriptions of exactly m keys, without spaces. The letter keys are marked with the corresponding lowercase letters. The "Shift" keys are marked with the "S" symbol. 

Then follow the length of the text q (1 ≤ q ≤ 5·105). The last line contains the text T, which consists of q symbols, which are uppercase and lowercase Latin letters.

Output

If Vasya can type the text, then print the minimum number of times he will have to use his other hand. Otherwise, print "-1" (without the quotes).

Examples

Input

2 2 1
ab
cd
1
A


Output

-1


Input

2 2 1
ab
cd
1
e


Output

-1


Input

2 2 1
ab
cS
5
abcBA


Output

1


Input

3 9 4
qwertyuio
asdfghjkl
SzxcvbnmS
35
TheQuIcKbRoWnFOXjummsovertHeLazYDOG


Output

2

Note

In the first sample the symbol "A" is impossible to print as there's no "Shift" key on the keyboard.

In the second sample the symbol "e" is impossible to print as there's no such key on the keyboard.

In the fourth sample the symbols "T", "G" are impossible to print with one hand. The other letters that are on the keyboard can be printed. Those symbols come up in the text twice, thus, the answer is 2.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
input = sys.stdin
output = sys.stdout

def square_euclid(x,y):
    return (x[0] - y[0])**2 + (x[1] - y[1])**2

def solve(size,lines,T,x):
    allkeys = ''.join(lines)
    symbols = set(list(allkeys))
    has_shift = 'S' in symbols

    text_symbols = set(list(T))
    text_symbols_lowercase = set(list(T.lower()))
    
    if not text_symbols_lowercase.issubset(symbols):
        return -1
    
    need_shift = False
    if text_symbols != text_symbols_lowercase:
        need_shift = True
        if not has_shift:
            return -1
    
#    print 'Need Shift:', need_shift
    # it is possible to type given text, counting pushes
    
    positions = {}
    for c in symbols:
        positions[c] = []
    
    n,m = size
    for i in range(len(lines)):#range(n):
        row = lines[i]
        for j in range(len(row)):#range(m):
            c = row[j]
            positions[c].append((i,j))
            
    min_d_to_shift = {}
    if need_shift:
        shift_positions = positions['S']
        normal_symbols = symbols - set('S')
        for c in normal_symbols:
            ps = positions[c]
            min_d = n*n + m*m + 1
            dds = [min_d]
            for p in ps:
                for sp in shift_positions:
                    dds.append(square_euclid(p, sp))
#                ds = [square_euclid(p, sp) for sp in shift_positions]
#                if ds:
#                    md = min(ds)
#                    if min_d > md:
#                        min_d = md
#            min_d_to_shift[c] = min_d
            min_d_to_shift[c] = min(dds)
    
#    print min_d_to_shift
    
    pushes = 0

    # text processing
    max_d_allowed = x*x
    if need_shift:
        for c in filter(lambda c: c.isupper(), T):
            c = c.lower()
            if min_d_to_shift[c] > max_d_allowed:
                pushes += 1

    return pushes


S = input.readline().split(' ')
n = int(S[0])
m = int(S[1])
x = int(S[2])
assert 1<=n and n<=30
assert 1<=m and m<=30
assert 1<=x and x<=50

lines = []
for r in range(n):
    line = input.readline().strip()
    lines.append(line)

q = int(input.readline())
assert 1<=q and q<=500000

T = input.readline().strip()
assert len(T) == q

min_pushes = solve((n,m),lines,T,x)

output.write('%s\n' % str(min_pushes))

2 2 1
ab
cS
5
abcBA
 3 9 4
qwertyuio
asdfghjkl
SzxcvbnmS
35
TheQuIcKbRoWnFOXjummsovertHeLazYDOG
 2 2 1
ab
cd
1
e
 2 2 1
ab
cd
1
A
 1 1 50
a
29
argjhoaiogjiSjqfhjksdvjkSvcvn
 10 9 3
oboxlgpey
yxcuwkkmp
juqeflhwq
sfnxqtjqS
kkudcnyjl
hgjlcrkjq
jnofqksxn
qbhsnuguv
lvahnifao
ebwnnlrwe
35
CodeforcesBetaRoundproblemAtestfive
 10 10 2
friuxvShvg
erslojqtgu
zeqsmdewry
wvhbeeyeSu
gkofbjaavr
twkcdxugps
nzlylSmafu
stamkpxnzt
uwxwximkrm
mzxyboazbl
100
mRIfAtrLKmztpVkAmojDCiIgseBwlUilBIixDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIiFBfaCirbmCa
 2 7 4
iuqtieo
ysxcgmS
2
sQ
 7 8 5
fqiubjpm
qbshcsyk
cjbxpbef
ptwpmapx
ryazscbm
qnvsgzrf
htardzkz
9
uxrmwkayy
 1 1 50
z
29
argjhoaiogjiSjqfhjksdvjkSvcvn
 10 10 1
mgziiihbkq
iobjknuogh
vntwahSopu
sjsxjpaqvm
wqgrodizst
selzugktoi
vbhfzvgjfn
liqlfdcjhf
bpbtpmimxb
pksfiydpfw
100
wAVZXEhKTuajdCauVTIwgnfbxWuUSmtXkjHZtNVcfTsiSAPLdpdEFdTJLZRjptUcRhAmrNjKMXmuDGatAQoaIpbddnzRGHsJrhoq
 10 10 3
rvouufmnqu
byukrnmnhr
zjggwxgvkz
tcagkSitiw
hryajgtpwc
jragfhqoks
kgroxxkuvp
bpgrkqiyns
jbuhjjkziw
omjmbaggsw
100
CpRzrPqPngYvrVJFCWRPMRwrpXcbtiwfoFcAkRaNjzpMMKOQAzBxSrxGbIHaYgmSqhhxhZTmhFttKnhFzRfKxYXshUZRvtKJIzZq
 10 10 26
wxmssptheb
zpxbxsyxsy
qbjkpaywqp
fwhnuzjcgq
ycgaanzedz
jrycrbzqfs
gswwakybus
fhtxhljedz
oSepmyjosv
dwviycevdn
100
yapwUfnyPzgZyFvAHGKWVbXQHkuhJDoUTvCAtdMMCQmKchxKkilUTECOqYJFUSHPqKiRKhDXZgHxwApDWlShdwakmVCgaeKCLOMX
 10 10 23
htyvouoiqi
vySvsfqadv
xvqyqjyutq
pjcrrphzbk
hlqfyoqfmo
ezcSwleoew
xkwqrajxyg
ngSiftgoso
jyndgicccr
lgjvokydhp
100
JzVVfotldIRcyjhTNRcFlTxFeZKRwavZxYcvdDOQyUvTmryFRuRBcRvmscegtspkPuchqlFEKbrfpTOSlSFOARsbbvSenMwNmaRj
 10 10 1
mdxafehbkr
yuhenybjps
tvfwmiwcoh
jmzrepzjvx
nqyorkSnuk
tSmztmwidv
cmmajnlqrw
fiqewpdwax
uesmkdcplt
lgkomdcqbo
100
mcEQmAvFqKYMXLHQUDeIulkmAMRkIUtbKihTFJwJYQfcAelNrZWSAwHunwZTrdHaRWokgCyLqbubOpEHuZiDVoFHjvkMSoBPyGOI
 8 6 4
efvmov
keofnw
pwajpe
knptky
Sibruu
rgdukk
bsxosd
hovgSe
10
ECreruXmsC
 10 10 2
bddahSqkmk
pxbocxayjs
ottvdazstk
laxuidqlqb
kfjwdpdfat
xlipuubkgv
iqyomzfktm
iwbgidmwyu
rngqkeupsf
bqndtekryw
100
MNQgWFLhHycqwjSsbTkbgMYAIHFYARRmOsinYMFjOxxnLjiKfeiBbMpoeTdzUMORPaAxRNfvdAPFaKkPdxdAjjJgGCxkDzmSasqq
 10 10 1
sufnxxpdnx
vttibpllhv
lvbrjmfdjx
gmtexvrnfh
ygsqrsSwxd
kxbbjxgbzs
edutwocmzd
febjgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaKtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 3 2
ukk
eqt
fex
qSh
tvz
fjn
iol
ehd
nte
gyx
5
cgQxI
 1 1 50
S
1
S
 10 10 1
qztnjglyrc
nukswgzajl
qnpbdwjvbb
liiakzcrlz
nolwfzzvxd
mqvhiySttx
qwuizSjuto
qbgwiwjukx
komyvblgkc
tkzlxzgsru
100
YUzTZDzLFkMUhjQWbwljJCRyZGFzgJcozvROiwPktRGxkMKiPyiTvhDrtusPYhMgVAOFIjAvlpzcrUvrMrMbhkpUiyAytKfYOGTF
 10 10 7
ifcwalsdbj
jpykymrbei
rylzgkyefh
oilvvexpjp
iptgodpfim
dSrqejaixu
pksxlsniwa
moSenxtfbc
oqssptcenz
qdhmouvyas
100
qtMDVUXJpSEFgPsLKyRJVRbfVoYaCKJDnQDLFVngVjSPzzVyMnMyuyahMRiBJuNhKtgpVqvukUolLvYEmidvXotgQUJukYwIweUW
 2 1 2
S
c
4
CSSA
 10 10 19
owqjcaSpqn
vgrhboqahn
bzziocjmbu
purqsmiSop
xcsifctjhy
ycyytwoamk
rnjfxsxowl
nkgcywcdff
bazljrisqv
kcakigSekq
100
zewpATtssQVicNrlRrcoifTutTAfFMUEfDFKoNyQbSrSYxTGMadNkRpmJvoEqUsqPYgAdQreaUrwDKMNFWiwdRRCcJBPorfMVMoK
 10 10 2
cstcrltzsl
blotmquzvj
uiitiytlgx
wumpfdaprd
tfxohqpztn
vfrpsccddo
neegusrkxw
iijfjozqjq
ioegbvuhew
pjjpqdxvqu
100
kPCBONfZLkeXzWVuSgvinPENazcnRoBcUHXwRzPyvNIiDlDSeKOYmiUmjooXuzTCtIRxKDAYeTLgjsenxHoymVazMALUADQpjVjV
 10 10 2
nhfafdwqhh
eyvitpcthk
rpiotuoqzh
nxxnhuaxee
yevrtirzwf
kbtSsamyel
feenjvxsmo
kqpenxjmde
lqsamthlwp
jdyyqsbtbk
100
UHucxPWDaKonVpXEctuqYUAQnrFEZaTYxhoacNbHIMevlbDejXjitEzyVrTfcfBHWRMdJvaTkbkqccyHjtzpTbKmRAXwlXCtFKNX
 1 1 50
S
29
argjhoaiogjiSjqfhjksdvjkSvcvn
 10 10 2
shbqxycvfm
otydudkttw
qhatsxsngz
ixvyujtyjc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpywggu
fcnfrhnouo
100
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 10 10 2
nxcwdrsmrv
Syjahsosvp
vkrqbxhgbv
wkxywavtnn
epkyoviqbi
sfmpvhuwwq
nlsostrotx
tcdguorhny
imixrqzSdu
xzhdhdwibt
100
UzzaWiRFYbAqxIDMrRBBDoGQhSzSqSLEddAiJsZcxbemdeuddamNYdWOvzlYSCuHIRpnuxdNxAsnZMiLXBYwnrMcrbNeLrUYhZOB
 1 2 4
bS
8
bBbbbBbb
 1 1 6
a
29
argjhoaiogjiSjqfhjksdvjkSvcvn
 10 9 3
oboxlgpey
yxcuwkkmp
juqeflhwq
sfnxqtjqS
kkudcnyjl
hgjlcrkjq
jnofqksxn
qbhsouguv
lvahnifao
ebwnnlrwe
35
CodeforcesBetaRoundproblemAtestfive
 10 10 2
friuxvShvg
erslojqtgu
zeqsmdewry
wvhbeeyeSu
gkofbjaavr
twkcdxugps
nzlylSmafu
stamkpxnzt
uwxwximkrm
mzxyboazbl
100
mRIfAtrLKmztpVkAmojDCiIgseBwlUilBIiyDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIiFBfaCirbmCa
 2 7 4
iuqtieo
ysxcgmS
2
Qs
 7 8 5
fqiubjpm
qbshcsyk
febpxbjc
ptwpmapx
ryazscbm
qnvsgzrf
htardzkz
9
uxrmwkayy
 10 10 1
mgziiihbkq
iobjknuogh
vntwahSopu
sjsxjpaqvm
wqgrodizst
selzugktoi
vbhfzvgjfn
liqlfdcjhf
bpbtpmimxb
pksfiydpfv
100
wAVZXEhKTuajdCauVTIwgnfbxWuUSmtXkjHZtNVcfTsiSAPLdpdEFdTJLZRjptUcRhAmrNjKMXmuDGatAQoaIpbddnzRGHsJrhoq
 10 10 3
qvouufmnqu
byukrnmnhr
zjggwxgvkz
tcagkSitiw
hryajgtpwc
jragfhqoks
kgroxxkuvp
bpgrkqiyns
jbuhjjkziw
omjmbaggsw
100
CpRzrPqPngYvrVJFCWRPMRwrpXcbtiwfoFcAkRaNjzpMMKOQAzBxSrxGbIHaYgmSqhhxhZTmhFttKnhFzRfKxYXshUZRvtKJIzZq
 10 10 2
bddahSqkmk
pxbocxayjs
ottvdazstk
laxuidqlqb
kfjwdpdfat
xlipuubkgv
iqyomzfktm
uywmdigbwi
rngqkeupsf
bqndtekryw
100
MNQgWFLhHycqwjSsbTkbgMYAIHFYARRmOsinYMFjOxxnLjiKfeiBbMpoeTdzUMORPaAxRNfvdAPFaKkPdxdAjjJgGCxkDzmSasqq
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdjx
gmtexvrnfh
ygsqrsSwxd
kxbbjxgbzs
edutwocmzd
febjgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaKtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 10 2
nhfafdwqhh
eyvitpcthk
rpiotuoqzh
nxxnhuaxee
yevrtirzwf
kbtSsamyfl
feenjvxsmo
kqpenxjmde
lqsamthlwp
jdyyqsbtbk
100
UHucxPWDaKonVpXEctuqYUAQnrFEZaTYxhoacNbHIMevlbDejXjitEzyVrTfcfBHWRMdJvaTkbkqccyHjtzpTbKmRAXwlXCtFKNX
 10 10 2
nxcwdrsmrv
pvsoshajyS
vkrqbxhgbv
wkxywavtnn
epkyoviqbi
sfmpvhuwwq
nlsostrotx
tcdguorhny
imixrqzSdu
xzhdhdwibt
100
UzzaWiRFYbAqxIDMrRBBDoGQhSzSqSLEddAiJsZcxbemdeuddamNYdWOvzlYSCuHIRpnuxdNxAsnZMiLXBYwnrMcrbNeLrUYhZOB
 10 10 1
mgziiihbkq
iobjknuogh
vntwahSopu
sjsxjpaqvm
wqgrodizst
selzugktoi
vbhfzvgjfn
liqlfdcjhf
bpbtpmimxb
pksfiydpfv
100
wAVZXEhKTuajdCauVTIwgnfbxWuUSmtXkjHZtNVcfTsiSAPLdpdEFdTJLZRjptUcRhAmrNjKMXmuDGatBQoaIpbddnzRGHsJrhoq
 10 10 2
bddahkqkmS
pxbocxayjs
ottvdazstk
laxuidqlqb
kfjwdpdfat
xlipuubkgv
iqyomzfktm
uywmdigbwi
rngqkeupsf
bqndtekryw
100
MNQgWFLhHycqwjSsbTkbgMYAIHFYARRmOsinYMFjOxxnLjiKfeiBbMpoeTdzUMORPaAxRNfvdAPFaKkPdxdAjjJgGCxkDzmSasqq
 8 6 1
efvmov
keofnw
pwajpe
knptky
Sicruu
rkdugk
bsxosd
hovgSe
10
ECrsruXmeC
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygsqrsSwxd
szbgxjbbxk
edutwocmzd
febjgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 10 1
sufnxxpdnx
vttibpllhv
lvbrjmfdjx
gmtexvrnfh
ygsqrsSwxd
kxbbjxgbzs
dzmcowtude
febjgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaKtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 1 1 50
z
29
argkhoaiogjiSjqfhjksdvjkSvcvn
 10 10 26
wxmssptheb
zpxbxsyxsy
qbjkpaywqp
fwhnuzjcgq
ycgaanzedz
jrycrbzqfs
gswwakybus
fhtxhliedz
oSepmyjosv
dwviycevdn
100
yapwUfnyPzgZyFvAHGKWVbXQHkuhJDoUTvCAtdMMCQmKchxKkilUTECOqYJFUSHPqKiRKhDXZgHxwApDWlShdwakmVCgaeKCLOMX
 10 10 43
htyvouoiqi
vySvsfqadv
xvqyqjyutq
pjcrrphzbk
hlqfyoqfmo
ezcSwleoew
xkwqrajxyg
ngSiftgoso
jyndgicccr
lgjvokydhp
100
JzVVfotldIRcyjhTNRcFlTxFeZKRwavZxYcvdDOQyUvTmryFRuRBcRvmscegtspkPuchqlFEKbrfpTOSlSFOARsbbvSenMwNmaRj
 10 10 1
mdxafehbkr
yuhenybjps
tvewmiwcoh
jmzrepzjvx
nqyorkSnuk
tSmztmwidv
cmmajnlqrw
fiqewpdwax
uesmkdcplt
lgkomdcqbo
100
mcEQmAvFqKYMXLHQUDeIulkmAMRkIUtbKihTFJwJYQfcAelNrZWSAwHunwZTrdHaRWokgCyLqbubOpEHuZiDVoFHjvkMSoBPyGOI
 8 6 4
efvmov
keofnw
pwajpe
knptky
Sibruu
rkdugk
bsxosd
hovgSe
10
ECreruXmsC
 10 3 4
ukk
eqt
fex
qSh
tvz
fjn
iol
ehd
nte
gyx
5
cgQxI
 1 1 65
S
1
S
 10 10 1
qztnjglyrc
nukswgzajl
qnpbdwjvbb
liiakzcrlz
nolwfzzvxd
mqvhiySttx
qwuizSjuto
qbgwiwjukx
komyvblgkc
tkzlxzgsru
100
YUzTYDzLFkMUhjQWbwljJCRyZGFzgJcozvROiwPktRGxkMKiPyiTvhDrtusPYhMgVAOFIjAvlpzcrUvrMrMbhkpUiyAytKfYOGTF
 10 10 7
ifcwalsdbj
jpykynrbei
rylzgkyefh
oilvvexpjp
iptgodpfim
dSrqejaixu
pksxlsniwa
moSenxtfbc
oqssptcenz
qdhmouvyas
100
qtMDVUXJpSEFgPsLKyRJVRbfVoYaCKJDnQDLFVngVjSPzzVyMnMyuyahMRiBJuNhKtgpVqvukUolLvYEmidvXotgQUJukYwIweUW
 10 10 2
cstcrltzsl
blotmquzvj
uiitiytlgx
wumpfdaqrd
tfxohqpztn
vfrpsccddo
neegusrkxw
iijfjozqjq
ioegbvuhew
pjjpqdxvqu
100
kPCBONfZLkeXzWVuSgvinPENazcnRoBcUHXwRzPyvNIiDlDSeKOYmiUmjooXuzTCtIRxKDAYeTLgjsenxHoymVazMALUADQpjVjV
 1 1 54
S
29
argjhoaiogjiSjqfhjksdvjkSvcvn
 10 10 2
shbqxycvfm
otydudkttw
qhatsxsngz
ixvyujtyjc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpyxggu
fcnfrhnouo
100
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 1 2 4
bS
5
bBbbbBbb
 3 9 4
qwertyuio
asdfghjkl
SzxcvbnmS
35
TheQuIcKbRoWnFPXjummsovertHeLazYDOG
 2 2 1
ab
dc
1
e
 10 9 3
oboxlgpey
yxcuwkkmp
juqeflhwq
sfnxqtjqS
kkudcnyjl
hgjlcrkjq
jxofqksnn
qbhsouguv
lvahnifao
ebwnnlrwe
35
CodeforcesBetaRoundproblemAtestfive
 10 10 2
friuxvShvg
erslojqtgu
zeqsmdewry
wvhbeeyeSu
gkofbjaavr
twkcdxugps
nzlylSmafu
stamkpxnzt
uwxwximkrm
mzxyboazbl
100
mRIfAtrLKmztpViAmojDCiIgseBwlUilBIiyDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIkFBfaCirbmCa
 7 8 5
fqiubjpm
qbshcsyk
febpxbjc
atwpmppx
ryazscbm
qnvsgzrf
htardzkz
9
uxrmwkayy
 10 10 1
mdxafehbkr
yuhenybjps
tvewmiwcoh
jmzrepzjvx
nqyorkSnuk
tSmztmwidv
wrqlnjammc
fiqewpdwax
uesmkdcplt
lgkomdcqbo
100
mcEQmAvFqKYMXLHQUDeIulkmAMRkIUtbKihTFJwJYQfcAelNrZWSAwHunwZTrdHaRWokgCyLqbubOpEHuZiDVoFHjvkMSoBPyGOI
 8 6 4
efvmov
keofnw
pwajpe
knptky
Sibruu
rkdugk
bsxosd
hovgSe
10
ECrsruXmeC
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygsqrsSwxd
kxbbjxgbzs
edutwocmzd
febjgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaKtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 3 4
ukk
eqt
fex
qSh
tvz
njf
iol
ehd
nte
gyx
5
cgQxI
 10 10 1
qztnjglyrc
nukswgzajl
qnpbdwjvbb
liiakzcrlz
nolwfzzvxd
mqvhiySttx
qwuizSjuto
qbgwiwjukx
komzvblgkc
tkzlxzgsru
100
YUzTYDzLFkMUhjQWbwljJCRyZGFzgJcozvROiwPktRGxkMKiPyiTvhDrtusPYhMgVAOFIjAvlpzcrUvrMrMbhkpUiyAytKfYOGTF
 10 10 2
cstcrltzsl
blotmquzvj
uiitiytlgx
wuapfdmqrd
tfxohqpztn
vfrpsccddo
neegusrkxw
iijfjozqjq
ioegbvuhew
pjjpqdxvqu
100
kPCBONfZLkeXzWVuSgvinPENazcnRoBcUHXwRzPyvNIiDlDSeKOYmiUmjooXuzTCtIRxKDAYeTLgjsenxHoymVazMALUADQpjVjV
 10 10 1
nhfafdwqhh
eyvitpcthk
rpiotuoqzh
nxxnhuaxee
yevrtirzwf
kbtSsamyfl
feenjvxsmo
kqpenxjmde
lqsamthlwp
jdyyqsbtbk
100
UHucxPWDaKonVpXEctuqYUAQnrFEZaTYxhoacNbHIMevlbDejXjitEzyVrTfcfBHWRMdJvaTkbkqccyHjtzpTbKmRAXwlXCtFKNX
 1 1 54
S
29
nvcvSkjvdskjhfqjSijgoiaohjgra
 10 10 2
shbqxycvfm
otydudkttw
qhatsxsngz
ixvyjjtyuc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpyxggu
fcnfrhnouo
100
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 2 2 1
ba
dc
1
e
 10 9 3
oboxlgpey
yxcuwkjmp
juqeflhwq
sfnxqtjqS
kkudcnyjl
hgjlcrkjq
jxofqksnn
qbhsouguv
lvahnifao
ebwnnlrwe
35
CodeforcesBetaRoundproblemAtestfive
 10 10 2
friuxvShvg
erslojqtgu
zeqsmdewry
wvebeeyhSu
gkofbjaavr
twkcdxugps
nzlylSmafu
stamkpxnzt
uwxwximkrm
mzxyboazbl
100
mRIfAtrLKmztpViAmojDCiIgseBwlUilBIiyDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIkFBfaCirbmCa
 7 8 5
fqiubjpm
qbshcsyk
febpxbjc
atwpmppx
ryazscbm
qnvsgzrf
ktardzhz
9
uxrmwkayy
 10 10 1
mgziiihbkq
iobjknuogh
vntwahSopu
sjsxjpaqvm
wqgdorizst
selzugktoi
vbhfzvgjfn
liqlfdcjhf
bpbtpmimxb
pksfiydpfv
100
wAVZXEhKTuajdCauVTIwgnfbxWuUSmtXkjHZtNVcfTsiSAPLdpdEFdTJLZRjptUcRhAmrNjKMXmuDGatBQoaIpbddnzRGHsJrhoq
 8 6 4
efvmov
keofnw
pwajpe
knptky
Sicruu
rkdugk
bsxosd
hovgSe
10
ECrsruXmeC
 10 10 2
bddahkqkmS
pxbocxayjs
ottvdazstk
laxuidqlqb
kfjwdpdfat
xlipuubkgv
iqyomzfktm
uywmdigbwi
rngqkeupsf
wyrketdnqb
100
MNQgWFLhHycqwjSsbTkbgMYAIHFYARRmOsinYMFjOxxnLjiKfeiBbMpoeTdzUMORPaAxRNfvdAPFaKkPdxdAjjJgGCxkDzmSasqq
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygsqrsSwxd
kxbbjxgbzs
edutwocmzd
febjgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 3 4
vkk
eqt
fex
qSh
tvz
njf
iol
ehd
nte
gyx
5
cgQxI
 10 10 1
qztnjglyrc
ljazgwskun
qnpbdwjvbb
liiakzcrlz
nolwfzzvxd
mqvhiySttx
qwuizSjuto
qbgwiwjukx
komzvblgkc
tkzlxzgsru
100
YUzTYDzLFkMUhjQWbwljJCRyZGFzgJcozvROiwPktRGxkMKiPyiTvhDrtusPYhMgVAOFIjAvlpzcrUvrMrMbhkpUiyAytKfYOGTF
 10 10 2
shbqxycvfm
otydudkttw
qhatsxsngz
ixvyjjtyuc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpyxggu
fcnfrhnouo
110
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 2 2 1
ba
cc
1
e
 10 10 2
friuxvShvg
ersloiqtgu
zeqsmdewry
wvebeeyhSu
gkofbjaavr
twkcdxugps
nzlylSmafu
stamkpxnzt
uwxwximkrm
mzxyboazbl
100
mRIfAtrLKmztpViAmojDCiIgseBwlUilBIiyDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIkFBfaCirbmCa
 7 8 5
fqiubjpm
qbshcsyk
febpxbjc
atwpmppx
ryazscbm
qnvsgzrf
ktardzhz
9
uxrmxkayy
 10 10 1
mgziiihbkq
iobjknuogh
vntwahSopu
sjsxjpapvm
wqgdorizst
selzugktoi
vbhfzvgjfn
liqlfdcjhf
bpbtpmimxb
pksfiydpfv
100
wAVZXEhKTuajdCauVTIwgnfbxWuUSmtXkjHZtNVcfTsiSAPLdpdEFdTJLZRjptUcRhAmrNjKMXmuDGatBQoaIpbddnzRGHsJrhoq
 10 3 4
vkk
eqt
fex
qSh
tvz
njf
iol
ehd
nte
gyx
2
cgQxI
 10 10 2
qhbsxycvfm
otydudkttw
qhatsxsngz
ixvyjjtyuc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpyxggu
fcnfrhnouo
110
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 8 6 1
efvmov
keofnw
pwajpe
knptky
Srciuu
rkdugk
bsxosd
hovgSe
10
ECrsruXmeC
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygsqrsSwxd
szbgxjbbxk
edutwocmzd
fbejgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 3 4
vkk
eqt
fex
qSh
tvz
fjn
iol
ehd
nte
gyx
2
cgQxI
 10 10 2
qhbsxycvfm
otydudkttw
qhatsxsngz
ixvyjjtyuc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpyxggu
fcnfrhnouo
100
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygsqrsSwxd
sjbgxzbbxk
edutwocmzd
fbejgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 3 4
vkk
eqt
fex
qSh
tvz
fjn
iol
ehd
nte
xyg
2
cgQxI
 10 10 2
qhbsxycvfm
otydudkttw
zgnsxstahq
ixvyjjtyuc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpyxggu
fcnfrhnouo
100
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygtqrsSwxd
sjbgxzbbxk
edutwocmzd
fbejgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 3 4
vkk
eqt
fex
qSh
tvz
fjn
iol
ehd
nte
yyg
2
cgQxI
 10 10 2
sufnxxpdnx
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygtqrsSwxd
sjbgxzbbxk
edutwocmzd
fbejgkniay
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 3 4
vkk
eqt
fex
qSh
tvz
fjn
iol
hed
nte
yyg
2
cgQxI
 10 10 2
xndpxxnfus
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygtqrsSwxd
sjbgxzbbxk
edutwocmzd
fbejgkniay
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
 10 10 2
xndpxxnfus
vttibpllhv
lvbrjmfdix
gmtexvrnfh
ygtqrsSwxd
sjbgxzbbxk
edutwocmzd
fbejgkniay
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIagKSCRvsbGUOXRqDlbpuEqkduYpW
 10 10 2
xndpxxnfus
vttibpllhv
lvbrjmfdix
gmtexvrnfh
tgyqrsSwxd
sjbgxzbbxk
edutwocmzd
fbejgkniay
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaJtAEdwMZJFYiZUFNDxdDIagKSCRvsbGUOXRqDlbpuEqkduYpW
 1 1 97
a
29
argjhoaiogjiSjqfhjksdvjkSvcvn
 10 9 3
oboxlgpey
yxcuwkkmp
juqeflhwq
sfnxqtjqS
kkudcnyjl
hgjlcrkjq
jnofqksxn
qbhvnugus
lvahnifao
ebwnnlrwe
35
CodeforcesBetaRoundproblemAtestfive
 2 7 4
iuqtieo
ysxcgmS
2
sP
 1 1 50
z
29
argjhoaiogjiSjqfhjlsdvjkSvcvn
 10 10 1
lgziiihbkq
iobjknuogh
vntwahSopu
sjsxjpaqvm
wqgrodizst
selzugktoi
vbhfzvgjfn
liqlfdcjhf
bpbtpmimxb
pksfiydpfw
100
wAVZXEhKTuajdCauVTIwgnfbxWuUSmtXkjHZtNVcfTsiSAPLdpdEFdTJLZRjptUcRhAmrNjKMXmuDGatAQoaIpbddnzRGHsJrhoq
 10 10 3
rvouufmnqu
byukrnmrhn
zjggwxgvkz
tcagkSitiw
hryajgtpwc
jragfhqoks
kgroxxkuvp
bpgrkqiyns
jbuhjjkziw
omjmbaggsw
100
CpRzrPqPngYvrVJFCWRPMRwrpXcbtiwfoFcAkRaNjzpMMKOQAzBxSrxGbIHaYgmSqhhxhZTmhFttKnhFzRfKxYXshUZRvtKJIzZq
 10 10 26
wxmssptheb
zpxbxsyxsy
qbjkpaywqp
fwhnuzjcgq
ycgaanzedz
jrycrbzqfs
gswwakybus
dhtxhljefz
oSepmyjosv
dwviycevdn
100
yapwUfnyPzgZyFvAHGKWVbXQHkuhJDoUTvCAtdMMCQmKchxKkilUTECOqYJFUSHPqKiRKhDXZgHxwApDWlShdwakmVCgaeKCLOMX
 10 10 1
mdxafehbkr
yuhenybjps
tvfwmiwcoh
jmzrepzjvx
nqyorkSnuj
tSmztmwidv
cmmajnlqrw
fiqewpdwax
uesmkdcplt
lgkomdcqbo
100
mcEQmAvFqKYMXLHQUDeIulkmAMRkIUtbKihTFJwJYQfcAelNrZWSAwHunwZTrdHaRWokgCyLqbubOpEHuZiDVoFHjvkMSoBPyGOI
 8 6 4
efvmov
keofnw
pwajpe
knptky
Sibruu
rgdulk
bsxosd
hovgSe
10
ECreruXmsC
 10 10 2
bddahSqkmk
pxbocxaxjs
ottvdazstk
laxuidqlqb
kfjwdpdfat
xlipuubkgv
iqyomzfktm
iwbgidmwyu
rngqkeupsf
bqndtekryw
100
MNQgWFLhHycqwjSsbTkbgMYAIHFYARRmOsinYMFjOxxnLjiKfeiBbMpoeTdzUMORPaAxRNfvdAPFaKkPdxdAjjJgGCxkDzmSasqq
 10 10 7
ifcwalsdbj
jpykymrbei
rylzgkyefh
oilvvexpjp
iptgodpfim
dSrqejaixu
pksxlsniwa
cbftxneSom
oqssptcenz
qdhmouvyas
100
qtMDVUXJpSEFgPsLKyRJVRbfVoYaCKJDnQDLFVngVjSPzzVyMnMyuyahMRiBJuNhKtgpVqvukUolLvYEmidvXotgQUJukYwIweUW
 10 10 28
owqjcaSpqn
vgrhboqahn
bzziocjmbu
purqsmiSop
xcsifctjhy
ycyytwoamk
rnjfxsxowl
nkgcywcdff
bazljrisqv
kcakigSekq
100
zewpATtssQVicNrlRrcoifTutTAfFMUEfDFKoNyQbSrSYxTGMadNkRpmJvoEqUsqPYgAdQreaUrwDKMNFWiwdRRCcJBPorfMVMoK
 10 10 2
cstcrltzsl
blotmquzvj
tiitiytlgx
wumpfdaprd
tfxohqpztn
vfrpsccddo
neegusrkxw
iijfjozqjq
ioegbvuhew
pjjpqdxvqu
100
kPCBONfZLkeXzWVuSgvinPENazcnRoBcUHXwRzPyvNIiDlDSeKOYmiUmjooXuzTCtIRxKDAYeTLgjsenxHoymVazMALUADQpjVjV
 10 10 2
shbqxycvfm
otydudkttw
qhatsxsngz
ixvyujtyjc
sbvqhnjbak
akuuugcgge
xcydfgjzeb
ytpdkcdrsq
efqlpywggu
fcnfrhnouo
100
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
 1 2 4
bS
8
bBbbbBab

1 2 -1 -1 -1 4 19 1 0 -1 39 12 0 0 39 -1 37 44 -1 -1 37 0 -1 0 -1 29 -1 -1 17 0 -1
 4
 19
 1
 0
 39
 12
 37
 34
 29
 18
 40
 38
 3
 33
 44
 -1
 0
 0
 39
 -1
 -1
 -1
 37
 0
 -1
 -1
 -1
 0
 -1
 -1
 4
 19
 0
 37
 -1
 34
 -1
 37
 -1
 38
 -1
 -1
 -1
 4
 19
 0
 40
 0
 38
 34
 -1
 37
 -1
 -1
 19
 0
 40
 -1
 -1
 3
 33
 -1
 -1
 33
 -1
 -1
 33
 -1
 33
 -1
 33
 33
 33
 -1
 4
 -1
 -1
 39
 12
 0
 39
 -1
 37
 0
 0
 -1
 -1
 -1
