Japan to Take Stakes in Ailing Companies