#include<cstdio>
#include<cstring>
#include<climits>
using namespace std;
const int N=1010,p=1e6+7,M=1e6+10;
int n,a[N],sit[M],f[M][2];bool vis[M];
int abs(int x){return x>0?x:-x;}
int hash(int x){
int ans=0;
for (int i=abs(x);i;i/=13) ans=(ans*23+i%13+17)%p;
while (sit[ans]!=x&&vis[ans]) ans=(ans==p?0:ans+1);
sit[ans]=x;
return ans;
}
int main()
{
freopen("plana.in","r",stdin);
freopen("plana.out","w",stdout);
for (int t=0;t<2;t++){
memset(vis,0,sizeof vis);
scanf("%d",&n);
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
for (int i=1;i<=n;i++)
for (int j=1;j<i;j++){
int p=hash(a[i]+a[j]);
if (!vis[p]){
vis[p]=1;f[p][0]=i;f[p][1]=j;
}
else{
if (f[p][0]!=i&&f[p][0]!=j) f[p][0]=0;
if (f[p][1]!=i&&f[p][1]!=j) f[p][0]=0;
}
}
int ans=INT_MIN;
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
if (i!=j){
int p=hash(a[i]-a[j]);
if (!vis[p]) continue;
if (i!=f[p][0]&&j!=f[p][0]&&i!=f[p][1]&&j!=f[p][1]&&a[i]>ans) ans=a[i];
}
if (ans!=INT_MIN) printf("%d\n",ans);
else puts("No Solution");
}
return 0;
}