An experimental setup consists of a uniform horizontal beam pivoted at its centre, as shown in the diagram below.

A small magnetic capsule is suspended from the left end of the beam. Directly above this capsule, a fixed electromagnet is mounted. Initially, the electromagnet is switched on, creating an upward magnetic force on the capsule. To maintain horizontal equilibrium, a heavy sliding counterweight is placed on the left side of the beam, at a distance d d\,d from the pivot.
The student reverses the direction of the current flowing through the electromagnet, which changes the upward force on the capsule to a downward force of the exact same magnitude.
Describe how the student can adjust the position of the sliding counterweight to bring the beam back into horizontal equilibrium, without changing any other part of the apparatus.