Dogs have been working alongside humans for much longer than we thought