#include using namespace std; #define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<int(a);) #define rep(i,n) repi(i,0,n) #define per(i,n) peri(i,0,n) #define all(c) begin(c),end(c) #define mp make_pair #define mt make_tuple using uint=unsigned; using ll=long long; using ull=unsigned long long; using vi=vector; using vvi=vector; using vl=vector; using vvl=vector; using vd=vector; using vvd=vector; using vs=vector; templatebool chmin(T& a,const U& b){return a>b?(a=b,1):0;} templatebool chmax(T& a,const U& b){return a void print_vars(ostream& os,const Car& car,const Cdr&... cdr){ print_vars(os< ostream& operator<<(ostream& os,const pair& p){ return os<<'('< void print_tuple(ostream&,const Tuple&){} template void print_tuple(ostream& os,const Tuple& t){ os<(t)<<(sizeof...(Cdr)?",":""); print_tuple(os,t); } template ostream& operator<<(ostream& os,const tuple& t){ print_tuple<0,Args...>(os<<'(',t); return os<<')'; } template basic_ostream& operator<<(basic_ostream& os,const C& c){ os<<'['; for(auto i=begin(c);i!=end(c);++i) os<<(i==begin(c)?"":" ")<<*i; return os<<']'; } constexpr int INF=1e9; constexpr int MOD=1e9+7; constexpr double EPS=1e-9; int solve(vl ds,ll x,ll y) { sort(all(ds)); ll u=abs(x-y),v=abs(x+y); if(u==0&&v==0) return 0; for(auto d:ds) if(d==u||d==v) return 1; for(auto d:ds) if(max(u,v)<=2*d) return 2; return -1; } int main() { #ifndef _GLIBCXX_DEBUG ios_base::sync_with_stdio(false); cin.tie(nullptr); constexpr char endl='\n'; #endif for(int n;cin>>n&&n;){ vl ds(n); rep(i,n) cin>>ds[i]; ll x,y; cin>>x>>y; cout<