Building vertical paths in exploring magnetic phenomena developing formal thinking