Metallic, magnetic and molecular nanocontacts