Nanojunctions as logic operators for the spintronics