Solving 3 languages using turing machine operations