use long and modular arithmetic