We have $31$ pieces where $1$ is written on two of them, $2$ is written on eight of them, $3$ is written on twelve of them, $4$ is written on four of them, and $5$ is written on five of them. We place  $30$ of them into a $5\times 6$ chessboard such that the sum of numbers on any row is equal to a fixed number and the sum of numbers on any column is equal to a fixed number. What is the number written on the piece which is not placed?

$ 
\textbf{(A)}\ 1
\qquad\textbf{(B)}\ 2
\qquad\textbf{(C)}\ 3
\qquad\textbf{(D)}\ 4
\qquad\textbf{(E)}\ 5
$
1. **Calculate the total sum of all 31 pieces:**
   \[
   \text{Sum} = 2 \cdot 1 + 8 \cdot 2 + 12 \cdot 3 + 4 \cdot 4 + 5 \cdot 5
   \]
   \[
   = 2 + 16 + 36 + 16 + 25
   \]
   \[
   = 95
   \]

2. **Determine the sum of the 30 pieces placed on the chessboard:**
   Since the sum of the numbers in each row and each column must be equal, the total sum of the numbers on the chessboard must be a multiple of both the number of rows (5) and the number of columns (6). Therefore, the sum must be a multiple of the least common multiple (LCM) of 5 and 6, which is 30.

3. **Express the sum of the 30 pieces in terms of the total sum:**
   Let \( x \) be the number on the piece that is not placed on the chessboard. Then the sum of the 30 pieces is:
   \[
   95 - x
   \]

4. **Set up the equation to find \( x \):**
   Since the sum of the 30 pieces must be a multiple of 30:
   \[
   30 \mid (95 - x)
   \]
   This means that \( 95 - x \) must be divisible by 30.

5. **Solve for \( x \):**
   To find \( x \), we need to determine the value that makes \( 95 - x \) a multiple of 30. We can test the possible values of \( x \) (1, 2, 3, 4, 5) to see which one satisfies the condition:
   \[
   95 - 1 = 94 \quad (\text{not divisible by 30})
   \]
   \[
   95 - 2 = 93 \quad (\text{not divisible by 30})
   \]
   \[
   95 - 3 = 92 \quad (\text{not divisible by 30})
   \]
   \[
   95 - 4 = 91 \quad (\text{not divisible by 30})
   \]
   \[
   95 - 5 = 90 \quad (\text{divisible by 30})
   \]

   Therefore, \( x = 5 \) is the only value that makes \( 95 - x \) a multiple of 30.

The final answer is \( \boxed{5} \).