Let $S=\{1,2,\cdots, n\}$ and let $T$ be the set of all ordered triples of subsets of $S$, say $(A_1, A_2, A_3)$, such that $A_1\cup A_2\cup A_3=S$. Determine, in terms of $n$,
\[ \sum_{(A_1,A_2,A_3)\in T}|A_1\cap A_2\cap A_3|\]
To solve the problem, we need to determine the sum of the sizes of the intersections of all ordered triples of subsets \((A_1, A_2, A_3)\) such that \(A_1 \cup A_2 \cup A_3 = S\).

1. **Understanding the Problem:**
   - We are given a set \(S = \{1, 2, \ldots, n\}\).
   - We need to consider all ordered triples \((A_1, A_2, A_3)\) of subsets of \(S\) such that \(A_1 \cup A_2 \cup A_3 = S\).
   - We need to find the sum \(\sum_{(A_1, A_2, A_3) \in T} |A_1 \cap A_2 \cap A_3|\).

2. **Counting the

The final answer is \(\boxed{n \cdot 7^{n-1}}\).