Two-Way Machines and de Bruijn Words