#include using namespace std; int T,a,b,c,d,e; long mod=1e9+7; int dp[2][20202]; const int off=10100; main() { cin>>T>>a>>b>>c>>d>>e; int now=0; dp[now][off]=1; for(int i=0;i