ll t,a[6],d,e;mint s[600][4d4],r;{rd(t,a(3),d,e);a[3..5]=-a[0..];s[0][2d4]=1;s[1....t][(20...3d4)+a[0..5]]+=s[0....][20...];r+=s[t][2d4+(d..e)];wt(r);}