Problem:
Max Score: 250 Points

Problem Statement

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.

Sample Input 1

2
tourist
petr
e

Sample Output 1

1

There are no invisible part, so there are only one possibility.
The sorted handle names are e, petr, tourist, so e comes first.

Sample Input 2

2
?o?r?s?
?et?
e

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);

string re(string s, char c,char c1) {
	for (auto& C : s) {
		if (C == c)C = c1;
	}
	return s;
}

int main() {
	int n; cin >> n;
	VS s(n); rep(i, n)cin >> s[i];
	string t; cin >> t;

	VS s1(n + 1);
	rep(i, n + 1) {
		s1[i] = re(i == n ? t : s[i], '?', 'a');
	}
	sort(all(s1));
	int ans1 = -1;
	rep(i, n + 1) {
		if (s1[i] == t)ans1 = i + 1;
	}

	VS s2(n + 1);
	rep(i, n + 1) {
		s2[i] = re(i == n ? t : s[i], '?', 'z');
	}
	sort(all(s2));
	int ans2 = -1;
	rep(i, n + 1) {
		if (s2[i] == t) { ans2 = i + 1; break; }
	}

	FOR(i, ans2, ans1 + 1) {
		cout << i << (i == ans1 ? "\n" : " ");
	}
}