Solution of the confinement problem in 1D