Theory of Minds: Understanding Behavior in Groups Through Inverse Planning