Ternary decoding software