#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100100;
const ll LI=1ll<<40;
ll gcd(ll a,ll b){return a?gcd(b%a,a):b;}
typedef pair<int,int>pii;
typedef pair<ll,pii>plp;
typedef vector<plp>vpp;
vpp cons[N];
plp tmp[100];
ll a[N],E;
int nxt[N],tri[N*60][2],sz,r[N];
map<ll,int>hd;
int cp(int a){tri[++sz][0]=tri[a][0],tri[sz][1]=tri[a][1];return sz;}
int ins(int rt,ll p,int pos){
// printf("Ins %04llx at pos %d\n",p,pos);
ll g=p;
int rr=rt=cp(rt);
for(int i=0;i<40;++i,p>>=1)
rt=tri[rt][p&1]?tri[rt][p&1]=cp(tri[rt][p&1]):(tri[rt][p&1]=++sz);
if(tri[rt][0])nxt[tri[rt][0]]=pos;else hd[g]=pos;
tri[rt][0]=pos;
return rr;
}
int qry(int rt,ll p){
for(int i=0;i<40;++i,p>>=1)
if(!tri[rt][p&1])return 0;else rt=tri[rt][p&1];
return tri[rt][0];
}
int main(){
freopen("starter.in","r",stdin);
freopen("starter.out","w",stdout);
int n;ll k;scanf("%d",&n);
for(int i=1;i<=n;++i)scanf("%lld",a+i);
for(int i=n;i;--i){
int _=cons[i+1].size();
for(int j=0;j<_;++j)
tmp[j+1]=plp(gcd(cons[i+1][j].first,a[i]),cons[i+1][j].second);
tmp[0]=plp(a[i],pii(i,i));
for(int a=0,b;a<=_;a=b){
for(b=a+1;tmp[b].first==tmp[a].first;++b);
cons[i].push_back(plp(tmp[a].first,pii(tmp[a].second.first,tmp[b-1].second.second)));
}
}scanf("%lld",&k);
for(int i=1;i<=n;++i)r[i]=ins(r[i-1],E^=a[i],i);
for(int i=((E=0),1),ql;i<=n;E^=a[i++]){
for(vpp::iterator j=cons[i].begin(),_=cons[i].end();j!=_;++j)
if(k%j->first==0){
ll t=k/j->first;
if(t<LI){
ql=qry(r[j->second.first-1],t^E);
// printf("#%d +[gcd %lld, [%d,%d]] %d Find %04llx^%04llx=%04llx\n",i,j->first,j->second.first,j->second.second,ql,t,E,t^E);
ql=ql?nxt[ql]:hd[t^E];
// printf("#%d +[gcd %lld, [%d,%d]] %d Find %04llx^%04llx=%04llx\n",i,j->first,j->second.first,j->second.second,ql,t,E,t^E);
if(ql<=j->second.second&&ql>=j->second.first)return printf("%d %d\n",i,ql),0;
}
}
}return puts("no solution"),0;
}