#include using namespace std; using ll = long long; int main(){ ll N, A, B, C; cin >> N >> A >> B >> C; vector dp(N+1); for (int i=0; i