  We study a simple axionlike model with a charged scalar $\phi$ and a
double-charged scalar $\zeta$ of global $U(1)$ symmetry. A particular feature
of our model is that a vacuum manifold is a torus knot. We consider a
hierarchical symmetry-breaking scenario where $\zeta$ first condenses, giving
rise to cosmic $\zeta$-strings, and the subsequent condensation of $\phi$ leads
to domain-wall formation spanning the $\zeta$-strings. We find that the
formation of the walls undergoes two different regimes depending on the
magnitude of an explicit breaking term of the relative $U(1)$ between $\zeta$
and $\phi$. One is the weakly interacting regime where the walls are
accompanied by another cosmic $\phi$ strings. The other is the strongly
interacting regime where no additional strings appear. In both regimes, neither
a $\zeta$-string, a $\phi$-string nor a wall alone is topological, but the
composite of an appropriate number of strings and walls as a whole is
topologically stable, characterized by the fundamental homotopy group of the
torus knot. We confirm the formation and the structure of the string-wall
system by first-principle cosmological two-dimensional simulations. We find
stable string-wall composites at equilibrium, where the repulsive force between
$\zeta$-strings and the tension of walls balances, and a novel reconnection of
the string-wall composites.
