#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int n;
int a[]={};
int f[][]={};
int sum[]={};
int sumn=;
int main(){
cin>>n;
for(int i=;i<=n;i++){
cin>>a[i];
sumn+=a[i];
sum[i]=sumn;
}
for(int i=;i<=sumn;i++){
f[][i]=-;
}
f[][]=;
for(int i=;i<=n;i++){
for(int j=;j<=sumn;j++){
f[i][j]=f[i-][j];
if(j>=a[i]&&f[i-][j-a[i]]>-){
f[i][j]=max(f[i][j],f[i-][j-a[i]]);
}
if(a[i]>j&&f[i-][a[i]-j]>-){
f[i][j]=max(f[i][j],f[i-][a[i]-j]+a[i]-j);
}
if(j+a[i]<=sumn&&f[i-][a[i]+j]>-){
f[i][j]=max(f[i][j],f[i-][a[i]+j]+a[i]);
}
}
}
if(f[n][]>){
cout<<f[n][]<<endl;
}
else{
cout<<"Impossible"<<endl;
}
return ;
}