Introducing ternary

fixed ternary.