public int count(int S, int gumi, int ia, int mayu)
	{
        long[][][][] dp=new long[S+1][S+1][S+1][S+1];
        long mod=1000000007;
        dp[0][0][0][0]=1;
        for (int i = 0; i < S; i++) {
            for (int a = 0; a <S ; a++) {
                for (int b = 0; b <S ; b++)
                    for (int c = 0; c < S; c++) {
                        long value = dp[i][a][b][c];
                        dp[i + 1][a][b][c] += value;
                        dp[i + 1][a + 1][b][c] %=mod;

                        dp[i + 1][a][b + 1][c] += value;
                        dp[i + 1][a][b + 1][c] %=mod;

                        dp[i + 1][a][b][c + 1] += value;
                        dp[i + 1][a][b][c + 1] %=mod;

                        dp[i + 1][a + 1][b + 1][c] += value;
                        dp[i + 1][a + 1][b + 1][c]%=mod;

                        dp[i + 1][a + 1][b][c + 1] += value;
                        dp[i + 1][a + 1][b][c + 1] %=mod;

                        dp[i + 1][a][b + 1][c + 1] += value;
                        dp[i + 1][a][b + 1][c + 1]%=mod;

                        dp[i + 1][a + 1][b + 1][c + 1] += value;
                        dp[i + 1][a + 1][b + 1][c + 1]%=mod;
                    }
            }
        }
        return (int)dp[S][gumi][ia][mayu];
    }