Self-organized growth controlled by charge states of magnetic impurities