Guy has 17 cards. Each of them has an integer written on it (the numbers are not necessarily positive, and not necessarily different from each other). Guy noticed that for each card, the square of the number written on it equals the sum of the numbers on the 16 other cards.

What are the numbers on Guy's cards? Find all of the options.
1. Let \( x_i \) be the integer written on the \( i \)-th card, where \( 1 \leq i \leq 17 \).
2. Define \( S_k = \sum_{i=1}^{17} x_i^k \) for \( k \in \{1, 2\} \).
3. The given condition states that for each card, the square of the number written on it equals the sum of the numbers on the other 16 cards. This can be written as:
   \[
   x_i^2 = S_1 - x_i
   \]
4. Rearrange the equation to get:
   \[
   x_i^2 + x_i = S_1
   \]
5. This implies that \( x_i \) is a root of the quadratic equation:
   \[
   x^2 + x - S_1 = 0
   \]
6. The roots of this quadratic equation are:
   \[
   x_i = \frac{-1 \pm \sqrt{1 + 4S_1}}{2}
   \]
7. Let \( n \) be the number of \( i \)'s for which \( x_i = \frac{-1 + \sqrt{1 + 4S_1}}{2} \) and \( 17 - n \) be the number of \( i \)'s for which \( x_i = \frac{-1 - \sqrt{1 + 4S_1}}{2} \).
8. According to the given condition, we have:
   \[
   \sum_{i=1}^{17} (x_i^2 + x_i) = 17S_1
   \]
   which simplifies to:
   \[
   S_2 + S_1 = 17S_1 \implies S_2 = 16S_1
   \]
9. Substituting the values of \( x_i \) into the equation for \( S_2 \), we get:
   \[
   (17 - n) \left( \frac{-1 + \sqrt{1 + 4S_1}}{2} \right)^2 + n \left( \frac{-1 - \sqrt{1 + 4S_1}}{2} \right)^2 = 16 \left( (17 - n) \frac{-1 + \sqrt{1 + 4S_1}}{2} + n \frac{-1 - \sqrt{1 + 4S_1}}{2} \right)
   \]
10. Simplifying the above equation, we get:
    \[
    15n(2x_1 - 1) = -17x_1(x_1 - 16)
    \]
11. Assume \( 17 \nmid 2x_1 - 1 \). Then \( 17 \mid n \) by the equation above, which implies \( n = 0 \) (since \( n < 17 \)). Hence, \( x_i = x_1 \) for all \( 1 \leq i \leq 17 \), where \( x_1 = 0 \) or \( x_1 = 16 \) by the equation above.
12. Next, assume \( 17 \mid 2x_1 - 1 \). The fact that \( \gcd(x_1, 2x_1 - 1) = 1 \) combined with the equation above implies:
    \[
    \frac{34(x_1 - 16)}{2x_1 - 1} = 17 - \frac{17 \cdot 31}{2x_1 - 1} \in \mathbb{Z}
    \]
    which (since \( 17 \mid 2x_1 - 1 \)) means:
    \[
    2x_1 - 1 = -17t, \quad t \in \{-31, -1, 1, 31\}
    \]
13. Then by the equation above:
    \[
    2x_1 - 1 \equiv -17 \cdot (\pm 1) = \mp 17 \equiv \mp 2 \pmod{5}
    \]
    yielding:
    \[
    x_1 \equiv 2, 4 \pmod{5}
    \]
14. But \( x_1 \equiv 0, 1 \pmod{5} \) by the equation above, contradicting the congruence above.

Therefore, the integers written on all 17 cards are the same. The number is either 0 or 16.

However, the provided solution mentions two valid configurations:
- 5 pieces of \( -6 \) and 12 pieces of \( 5 \)
- 5 pieces of \( -2 \) and 12 pieces of \( 1 \)

These configurations can be verified by hand.

The final answer is \( \boxed{0 \text{ or } 16} \) and the configurations \( \{5 \times -6, 12 \times 5\} \) and \( \{5 \times -2, 12 \times 1\} \).