#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>A[0]>>A[1]; cin>>B[0]>>B[1]; cin>>C>>D; ll x=min(C,A[1]); ll y=C-x; A[0]-=y; A[1]-=x; B[0]+=y; B[1]+=x; x=min(D,B[0]); y=D-x; cout<