The eight points $A, B,. . ., G$ and $H$ lie on five circles as shown. Each of these letters are represented by one of the eight numbers $1, 2,. . ., 7$ and $ 8$ replaced so that the following conditions are met:
(i) Each of the eight numbers is used exactly once.
(ii) The sum of the numbers on each of the five circles is the same.
How many ways are there to get the letters substituted through the numbers in this way?

(Walther Janous)
[img]https://cdn.artofproblemsolving.com/attachments/5/e/511cdd2fc31e8067f400369c4fe9cf964ef54c.png[/img]
1. Let \( A + B + C + D = T \). Since the sum of the numbers on each of the five circles is the same, we have:
   \[
   5T = A + B + C + D + E + F + G + H + 2(A + B + C + D)
   \]
   Simplifying, we get:
   \[
   5T = 36 + 2T \implies 3T = 36 \implies T = 12
   \]
   Hence, the sum of the numbers on each of the five circles is \( 12 \).

2. We need to find sets of four numbers from \(\{1, 2, 3, 4, 5, 6, 7, 8\}\) that sum to \( 12 \). The possible sets are:
   \[
   \{1, 2, 4, 5\} \quad \text{and} \quad \{1, 2, 3, 6\}
   \]

3. **Case 1: \(\{A, B, C, D\} = \{1, 2, 4, 5\}\)**
   - One of the numbers \( E, F, G, H \) must be \( 8 \). Let this number be \( E \).
   - Then, \( A + B = 4 \) and \(\{A, B\} \subseteq \{1, 2, 4, 5\}\).
   - However, there is no pair in \(\{1, 2, 4, 5\}\) that sums to \( 4 \). Thus, there is no solution in this case.

4. **Case 2: \(\{A, B, C, D\} = \{1, 2, 3, 6\}\)**
   - One of the numbers \( E, F, G, H \) must be \( 8 \). Let this number be \( E \). (We have 4 options here).
   - Then, \( A + B = 4 \) and \(\{A, B\} \subseteq \{1, 2, 3, 6\}\).
   - The only pair in \(\{1, 2, 3, 6\}\) that sums to \( 4 \) is \(\{1, 3\}\). So, \(\{A, B\} = \{1, 3\}\). Without loss of generality, let \( A = 1 \) and \( B = 3 \). (We have 2 options here).

5. If \( D = 2 \), then \( H = 9 \), which is a contradiction since \( H \) must be one of \(\{1, 2, 3, 4, 5, 6, 7, 8\}\). Thus, \( D = 6 \) and \( C = 2 \).

6. From here, we can find the remaining numbers:
   - \( F = 7 \)
   - \( G = 4 \)
   - \( H = 5 \)

7. So, when we determine which number is \( 8 \) and the order of its neighbors, we have a unique distribution for the others. Thus, we have \( 4 \times 2 = 8 \) solutions in total.

The final answer is \( \boxed{ 8 } \)