I want to get the following result.

[![enter image description here](https://i.stack.imgur.com/ebiYV.png)](https://i.stack.imgur.com/ebiYV.png)

My attempt below produces something that is not good as follows.

[![enter image description here](https://i.stack.imgur.com/u6zHQ.png)](https://i.stack.imgur.com/u6zHQ.png)

```
\documentclass[preview]{standalone}
\usepackage{amsmath}

\begin{document}
\abovedisplayskip=0pt\relax
\begin{alignat*}{3}
S   &=   1      &+   2      &+ \cdots &+  99    &+ 100 \\
S   &= 100    &+  99        &+ \cdots &+   2    &+   1\\
2S  &= 101    &+ 101      &+ \cdots &+ 101  &+ 101
\end{alignat*}
\end{document}

```