p03751 square869120Contest #4 - Atcoder Handles_9787
Mr.X, who the handle name is T, looked at the list which written N handle names, S_1, S_2, ..., S_N.
But he couldn't see some parts of the list. Invisible part is denoted `?`.

Please calculate all possible index of the handle name of Mr.X when you sort N+1 handle names (S_1, S_2, ..., S_N and T) in lexicographical order.
Note: If there are pair of people with same handle name, either one may come first.

Input

The input is given from standard input in the following format.



N
S_1
S_2
:
S_N
T


Output

* Calculate the possible index and print in sorted order. The output should be separated with a space. Don't print a space after last number.
* Put a line break in the end.



Constraints

* 1 ≤ N ≤ 10000
* 1 ≤ |S_i|, |T| ≤ 20 (|A| is the length of A.)
* S_i consists from lower-case alphabet and `?`.
* T consists from lower-case alphabet.



Scoring

Subtask 1 [ 130 points ]

* There are no `?`'s.



Subtask 2 [ 120 points ]

* There are no additional constraints.

Output

* Calculate the possible index and print in sorted order. The output should be separated with a space. Don't print a space after last number.
* Put a line break in the end.



Constraints

* 1 ≤ N ≤ 10000
* 1 ≤ |S_i|, |T| ≤ 20 (|A| is the length of A.)
* S_i consists from lower-case alphabet and `?`.
* T consists from lower-case alphabet.



Scoring

Subtask 1 [ 130 points ]

* There are no `?`'s.



Subtask 2 [ 120 points ]

* There are no additional constraints.

Input

The input is given from standard input in the following format.



N
S_1
S_2
:
S_N
T

Example

Input

2
tourist
petr
e


Output

1
n = int(raw_input())
l = [raw_input().strip() for _ in xrange(n)]
t = raw_input().strip()
for i in xrange(n):
    l[i] += '0' * (20 - len(l[i]))
t += '0' * (20 - len(t))
a = b = p = 0
for s in l:
    c = 0
    for i in xrange(20):
        if s[i] != '?' and s[i] < t[i]:
            c |= 1
            break
        if s[i] != '?' and s[i] > t[i]:
            c |= 2
            break
        if s[i] == '0' and t[i] == '0':
            c |= 3
            break
        if s[i] == '0' and t[i] != '0':
            c |= 1
            break
        if s[i] != '0' and t[i] == '0':
            c |= 2
            break
        if s[i] == t[i]:
            continue
        if t[i] != 'a':
            c |= 1
        if t[i] != 'z':
            c |= 2
    else:
        c |= 3
    if c == 3:
        p += 1
    elif c == 1:
        a += 1
    elif c == 2:
        b += 1
r = range(a + 1, a + p + 2)
print ' '.join(map(str, r))

2
tourist
petr
e 2
tourist
eptr
e 2
ssvuhnr
errs
f 2
hupouvt
etor
i 2
sourist
eptr
e 2
sourist
eqtr
e 2
sourist
etqr
e 2
sourisu
etqr
e 2
sourisu
etqr
d 2
sourisu
etrr
d 2
sourisu
rrte
d 2
souuisr
rrte
d 2
ssuuior
rrte
d 2
ssuuior
srte
d 2
ssuuior
etrs
d 2
ssvuior
etrs
d 2
ssvuior
etss
d 2
ssvuior
sste
d 2
ssvuior
sste
e 2
ssvuior
sset
e 2
ssvuior
sset
f 2
ssvuior
tses
f 2
ssvuior
sses
f 2
ssvuhor
sses
f 2
ssvuhor
sres
f 2
ssvuhor
sers
f 2
ssvuhor
rers
f 2
ssvuhnr
rers
f 2
rnhuvss
errs
f 2
rnhuvss
srre
f 2
rnguvss
srre
f 2
vngurss
srre
f 2
vngurss
srre
e 2
nvgurss
srre
e 2
gvnurss
srre
e 2
ssrunvg
srre
e 2
ssrunug
srre
e 2
ssrunug
srre
d 2
ssrunug
errs
d 2
ssrunug
drrs
d 2
ssrunug
drrs
e 2
ssrunug
srrd
e 2
ssrunug
srrd
f 2
rsrunug
srrd
f 2
rsrunug
srrd
e 2
rsrunug
drrs
e 2
rsrunug
drrs
d 2
rsrunug
srrd
d 2
rsrunug
srre
d 2
rsrunug
srre
e 2
rsrunug
errs
e 2
rsruntg
errs
e 2
rsruntg
ersr
e 2
rsruntf
ersr
e 2
ssruntf
ersr
e 2
struntf
ersr
e 2
struntf
ersr
d 2
struntf
essr
d 2
struntg
essr
d 2
ttrunsg
essr
d 2
ttrunsg
essr
c 2
ttrumsg
essr
c 2
ttrumsg
essr
b 2
ttrumsh
essr
b 2
ttrumsh
essr
a 2
ttrumth
essr
a 2
htmurtt
essr
a 2
htmurtt
essr
` 2
htmurtt
rsse
` 2
htmurtt
rsse
a 2
htmurtt
rsse
b 2
htlurtt
rsse
b 2
htltrtt
rsse
b 2
ttrtlth
rsse
b 2
ttrtmth
rsse
b 2
htmtrtt
rsse
b 2
ttrtmth
rsse
c 2
htmtrtt
rsse
c 2
htmtrtt
rssf
c 2
htmtrtt
rsrf
c 2
ttrtmth
rsrf
c 2
ttrtmth
rsre
c 2
thrtmtt
rsre
c 2
thrtntt
rsre
c 2
thrtntt
rsse
c 2
ttrtnth
rsse
c 2
ttqtnth
rsse
c 2
ttqtnth
ress
c 2
tqttnth
ress
c 2
tqttnth
resr
c 2
uqttnth
resr
c 2
uqttnth
ersr
c 2
nqttuth
ersr
c 2
nqttuth
ersr
d 2
nqttuth
srer
d 2
htuttqn
srer
d 2
htuttnq
srer
d 2
htuttnq
srer
c 2
htuttnq
sqer
c 2
htuttnq
tqer
c 2
htuttnq
tqer
b
1 1
 2
 3
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 2
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 2
 1
 1
 1
 1
 2
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
 1
