Mercedes-AMG will pull out of Formula 1 following a year-long battle over the sport's governing body.The German automaker will make its first race in 2018,…