#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair P; typedef pair E; #define MOD (1000000007ll) #define l_ength size #define EPS (1e-10) void add_mod(ll &a, ll b){ a += b; a %= MOD; } void mul_mod(ll &a, ll b){ a *= b; a %= MOD; } int main(void){ int n,i,j,w[123],s=0; bool p[12345]; cin >> n; fill(p,p+12345,true); p[0] = false; for(i=0; i> w[i]; s += w[i]; } for(i=0; i