Samsung N910F stuck at optimizing apps after flash


Hello. I have this Samsung note 4 N910F with no IMEI and I decided to flash again 5.1.1 because I wasn’t able to reset MSL. After I did that the phone keeps rebooting when It gets to "android is optimising apps". Sometimes It restarts at 10 of 24, sometimes at 15 of 24…

Please help.