##C++##
unsigned int Rand4()
{
unsigned int r = Rand5();
while(r == 5)
r = Rand5();
return(r);
}
unsigned int myRand2()
{
return((Rand4() - 1) & 1);
}
unsigned int Rand7()
{
return(((myRand2() << 2) | (myRand2() << 1) | myRand2()) + 1);
}