Scaffold for legendre symbols