A cupboard door in a student's kitchen will not stay closed. The student wants to use two magnets to keep the door closed. She plans to glue magnet A to the cupboard and magnet B to the inside of the door.

How will the student need to glue the two magnets for her idea to work?