Sharks win absorbing grand final battle