Study of the rare decay K± ->pi±gg