Mass determination of the 1:3:5 near-resonant planets transiting GJ 9827 (K2-135)