#include using namespace std; using ll = long long; template using Pa = pair; template using vec = vector; template using vvec = vector>; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; vec X(3); cin >> N >> X[0] >> X[1] >> X[2]; vec B = {1000,5000,10000}; vec A(N); bool ok = true; for(int i=0;i> A[i]; A[i]++; } for(int j=2;j>=0;j--){ for(int i=0;i()); for(int i=0;i