How to connect Ms0, ms1, ms2 from A4988 driver to arduino mega?

Im searching evreywhere into web but anyone have same problem: I have to set 1/16 microstepping on my A4988 driver connected to arduino mega.... With Ramps board is simple because you have only to put 3 jumper under the driver, but with arduino what I have to do? Connect to gnd? connect to +5v?

If you don't want to change the setting later then connect the pins to Gnd or Vcc just like you had set the jumpers. Else connect to Arduino output pins and do digitalWrite() as required.