Course work for second course. Realisation of three machines algorithm