Let the coordinates of the vertices of the triangle be \( A(x_1, y_1, z_1) \), \( B(x_2, y_2, z_2) \), and \( C(x_3, y_3, z_3) \). The midpoints of the sides of the triangle are given as:
- Midpoint of \( BC \) is \( M_1 = (1, 5, -1) \),
- Midpoint of \( CA \) is \( M_2 = (0, 4, -2) \),
- Midpoint of \( AB \) is \( M_3 = (2, 3, 4) \).
Using the midpoint formula:
\[
M = \left( \frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}, \frac{z_1 + z_2}{2} \right).
\]
Now, solve the system of equations derived from these midpoints:
\[
x_2 + x_3 = 2, \quad y_2 + y_3 = 10, \quad z_2 + z_3 = -2,
\]
\[
x_3 + x_1 = 0, \quad y_3 + y_1 = 8, \quad z_3 + z_1 = -4,
\]
\[
x_1 + x_2 = 4, \quad y_1 + y_2 = 6, \quad z_1 + z_2 = 8.
\]
Solving these equations gives the coordinates of the vertices as:
\[
A(1, 2, 3), \quad B(3, 4, 5), \quad C(-1, 6, -7).
\]
Final Answer:
\[
\boxed{A(1, 2, 3), B(3, 4, 5), C(-1, 6, -7)}.
\]