import java.util.*; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main().run(); } void run() { int n = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); int z = sc.nextInt(); int[] arr = new int[n]; for (int i=0; i=10000) { int cnt = arr[i]/10000; int remain = arr[i]%10000; if (z0) { label: for (int i=n-1; i>=0; i--) { arr[i] = 0; z--; if (z==0) break label; } } label: for (int i=0; i=5000) { int cnt = arr[i]/5000; int remain = arr[i]%5000; if (y0) { label: for (int i=n-1; i>=0; i--) { arr[i] = 0; y--; if (y==0) break label; } } label: for (int i=0; i