import java.util.HashMap;
import java.util.Map;

public class Euler475 {
    private static final long kMod = 1_000_000_007L;

    private static long modPow(long base, long exp) {
        long out = 1;
        base %= kMod;
        while (exp > 0) {
            if (exp % 2 == 1) {
                out = (out * base) % kMod;
            }
            base = (base * base) % kMod;
            exp /= 2;
        }
        return out;
    }

    private static int packState(int c0, int c1, int c2, int c3) {
        return (c0 << 24) | (c1 << 16) | (c2 << 8) | c3;
    }

    private static long solve(int musicians) {
        int n = musicians / 12;
        int m = 3 * n;
        int t = 4 * n;

        long[][] comb = new long[m + 1][4];
        for (int i = 0; i <= m; i++) {
            comb[i][0] = 1;
            if (i >= 1)
                comb[i][1] = i;
            if (i >= 2)
                comb[i][2] = (long) i * (i - 1) / 2;
            if (i >= 3)
                comb[i][3] = (long) i * (i - 1) * (i - 2) / 6;
        }

        int[][] picks = new int[20][4];
        int pickCount = 0;
        for (int x0 = 0; x0 <= 3; ++x0) {
            for (int x1 = 0; x1 + x0 <= 3; ++x1) {
                for (int x2 = 0; x2 + x1 + x0 <= 3; ++x2) {
                    int x3 = 3 - x0 - x1 - x2;
                    picks[pickCount][0] = x0;
                    picks[pickCount][1] = x1;
                    picks[pickCount][2] = x2;
                    picks[pickCount][3] = x3;
                    pickCount++;
                }
            }
        }

        Map<Integer, Long> cur = new HashMap<>();
        Map<Integer, Long> nxt = new HashMap<>();
        cur.put(packState(m, 0, 0, 0), 1L);

        for (int step = 0; step < t; step++) {
            nxt.clear();
            for (Map.Entry<Integer, Long> entry : cur.entrySet()) {
                int key = entry.getKey();
                long waysSoFar = entry.getValue();

                int c0 = (key >> 24) & 0xFF;
                int c1 = (key >> 16) & 0xFF;
                int c2 = (key >> 8) & 0xFF;
                int c3 = key & 0xFF;

                for (int i = 0; i < pickCount; i++) {
                    int[] pick = picks[i];
                    int x0 = pick[0], x1 = pick[1], x2 = pick[2], x3 = pick[3];

                    if (x0 > c0 || x1 > c1 || x2 > c2 || x3 > c3)
                        continue;

                    int nc0 = c0 - x0;
                    int nc1 = c1 - x1 + x0;
                    int nc2 = c2 - x2 + x1;
                    int nc3 = c3 - x3 + x2;

                    long waysPick = comb[c0][x0];
                    waysPick = (waysPick * comb[c1][x1]) % kMod;
                    waysPick = (waysPick * comb[c2][x2]) % kMod;
                    waysPick = (waysPick * comb[c3][x3]) % kMod;

                    long add = (waysSoFar * waysPick) % kMod;
                    int nkey = packState(nc0, nc1, nc2, nc3);

                    long currentVal = nxt.getOrDefault(nkey, 0L);
                    nxt.put(nkey, (currentVal + add) % kMod);
                }
            }
            Map<Integer, Long> temp = cur;
            cur = nxt;
            nxt = temp;
        }

        long matrixCount = cur.getOrDefault(packState(0, 0, 0, 0), 0L);
        long assignQuartetMembers = modPow(24, m);

        long factT = 1;
        for (int i = 2; i <= t; ++i) {
            factT = (factT * i) % kMod;
        }
        long invFactT = modPow(factT, kMod - 2);

        long out = (matrixCount * assignQuartetMembers) % kMod;
        out = (out * invFactT) % kMod;

        return out;
    }

    public static void main(String[] args) {
        System.out.println(solve(600));
    }
}
