Show that $$\sup_{x_1, \dots, x_n \in \mathscr{X}}|\mathscr{F}(x_1, \dots, x_n)|=S(\mathscr{A}, n)$$ where $S(\mathscr{A}, n)$ denotes the n-th shattering number of the class $$\mathscr{A}=\{A_f: f \in \mathscr{F}\}$$ where $$A_f = \{x \in \mathscr{X}: f(x) = 1\}$$
I don't quite understand how to approach this problem. Any help will be highly appreciated.