G=S_0, S_{\infty}=max_i \{a_i\},S_{-\infty}=min_i \{a_i\}