  The four-layered F/S/F$'$/S$'$ nanostructure consisting of rather dirty
superconducting (S) and ferromagnetic (F) metals is studied within the theory
of the proximity effect taking detailed account of the boundary conditions. The
F/S structures with four F and S layers are shown to have considerably richer
physics than the F/S/F trilayer (due to the interplay between the 0 and $\pi$
phase superconductivity and the 0 and $\pi$ phase magnetism) and even the F/S
superlattices. The extra $\pi $ phase superconducting states obtained for the
four-layered F/S/F$^{\prime }$/S$^{\prime }$ system are found to be different
from the known "superlattice" states. The dependence of the critical
temperatures versus the F layers thicknesses is investigated. An optimal set of
parameters is determined, for which the difference between the critical
temperatures for different states becomes significant, and the corresponding
phase diagrams are plotted. It is proven that this system can have different
critical temperatures for different S and S$'$ layers. A conceptual scheme of a
control device with superconducting and magnetic recording channels that can be
controlled separately using a weak external magnetic field is proposed on the
basis of the F/S/F$'$/S$'$ nanostructure. The devices with four, five, six, and
seven different states are explored.
