Fabrication of ultrathin magnetic structures by nanostencil lithography in dynamic mode