Optimal tax on capital inflows discriminated by debt-risk profile