  In this paper we study the regularity of the free boundary for a
vector-valued Bernoulli problem, with no sign assumptions on the boundary data.
More precisely, given an open, smooth set of finite measure $D\subset
\mathbb{R}^d$, $\Lambda>0$ and $\varphi_i\in H^{1/2}(\partial D)$, we deal with
\[ \min{\left\{\sum_{i=1}^k\int_D|\nabla
v_i|^2+\Lambda\Big|\bigcup_{i=1}^k\{v_i\not=0\}\Big|\;:\;v_i=\varphi_i\;\mbox{on
}\partial D\right\}}. \] We prove that, for any optimal vector $U=(u_1,\dots,
u_k)$, the free boundary $\partial (\cup_{i=1}^k\{u_i\not=0\})\cap D$ is made
of a regular part, which is relatively open and locally the graph of a
$C^\infty$ function, a singular part, which is relatively closed and has
Hausdorff dimension at most $d-d^*$, for a $d^*\in\{5,6,7\}$ and by a set of
branching (two-phase) points, which is relatively closed and of finite
$\mathcal{H}^{d-1}$ measure. Our arguments are based on the NTA structure of
the regular part of the free boundary.
