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
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s[11111],t;
int n;

int F(string a,string b){
	bool ok[2]={0,0};
	for(int i=0;i<a.size();i++){
		if(i==b.size()){ok[0]=1;break;}
		if(a[i]=='?')if('z'>b[i]){ok[0]=1;break;}
		if(a[i]>b[i]){ok[0]=1;break;}
		if(a[i]<b[i])break;
	}//大きい可能性

	for(int i=0;i<a.size();i++){
		if(i==b.size()){break;}
		if(a[i]=='?')if('a'<b[i]){ok[1]=1;break;}
		if(a[i]<b[i]){ok[1]=1;break;}
		if(a[i]>b[i])break;
		if(i==a.size()-1&&b.size()>a.size()){ok[1]=1;break;}
	}//小さい可能性

	if(ok[0]&&ok[1])return 2;
	if(!ok[0]&&ok[1])return 1;
	if(ok[0]&&!ok[1])return 0;
	return 2;
}

int main(){
	cin>>n;
	for(int i=0;i<n;i++)cin>>s[i];
	cin>>t;
	int a=0,b=0,c;
	for(int i=0;i<n;i++){
		c=F(s[i],t);
		if(c==1)a++;
		if(c==2)b++;
	}
	bool f=0;
	for(int i=a;i<=a+b;i++){
		if(f)cout<<" ";
		f=1;
		cout<<i+1;
	}
	cout<<endl;
	return 0;
}