reverse-grains-formula ======================