Answer
$B=(B\cap A_1)\cup (B\cap A_2)\cup ...... \cup(B\cap A_n)$
Work Step by Step
Based on the given conditions, $A_i$ and $A_j$ are disjoint to each other, and we can illustrate the situation as shown in the figure.
With the definition of $S$ and we can have an expression:
$A_i=S\cap A_i$.
As $B$ is any event from $S$, we have:
$B=B\cap S=B\cap(A_1\cup A_2\cup\dots A_n)=(B\cap A_1)\cup (B\cap A_2)\cup ...... \cup(B\cap A_n)$