The pretty obvious solution would be for more nominal taxes to be collected. It would also replace a very large fraction of existing government spending. Or you might have a one-time election between receiving the UBI and receiving social security, and a lot of people in or near retirement would choose social security and then not have to be provided with a UBI, and everyone else wouldn't have to be provided with social security.
Doing the accounting in a naive way is also misleading with a UBI, because it's effectively a tax credit. If you paid $15,000 in taxes and received a $12,000 UBI, you're really in the same situation as if you paid $3000 in taxes and had no UBI. The fact that you're nominally paying $12,000 more in taxes doesn't actually affect you because you get all that back.