Devise a Turing machine with input given in unary notation (i.e., a string of n 1's denotes the integer n, and numbers are delimited by 0's) such that the machine produces the following output:
0 if x is divisible by 4
1 if x is congruent to 1 modulo 4
2 if x is congruent to 2 modulo 4
3 if x is congruent to 3 modulo 4
Show the state table for the machine.