void alte_Animationen ()
{
int time1 = 1000;
int time = 100;
int time2 = 200;
int time3 = 150;
int time3_1 = 500;
int x = 0;


 
 for(int i = 0; i<10 ; i++)
  {
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
  digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 for (int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rDb,LOW);
 digitalWrite(rDc,LOW);
 digitalWrite(rDd,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 
}

 
 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rCd,LOW);
 digitalWrite(rDc,LOW);
 digitalWrite(rDd,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rCd,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}

 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rCd,LOW);
 digitalWrite(rBd,LOW);
 digitalWrite(rDd,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rCd,HIGH);
 digitalWrite(rBd,HIGH);
 digitalWrite(rDd,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}

 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rCd,LOW);
 digitalWrite(rBd,LOW);
 digitalWrite(rAd,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rCd,HIGH);
 digitalWrite(rBd,HIGH);
 digitalWrite(rAd,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}


 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rAc,LOW);
 digitalWrite(rBd,LOW);
 digitalWrite(rAd,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rAc,HIGH);
 digitalWrite(rBd,HIGH);
 digitalWrite(rAd,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}


 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rAc,LOW);
 digitalWrite(rAb,LOW);
 digitalWrite(rAd,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rAc,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAd,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}


 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rAc,LOW);
 digitalWrite(rAb,LOW);
 digitalWrite(rAa,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rAc,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAa,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}

 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rBa,LOW);
 digitalWrite(rAb,LOW);
 digitalWrite(rAa,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rBa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAa,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}


 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rBa,LOW);
 digitalWrite(rCa,LOW);
 digitalWrite(rAa,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rBa,HIGH);
 digitalWrite(rCa,HIGH);
 digitalWrite(rAa,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}

 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rBa,LOW);
 digitalWrite(rCa,LOW);
 digitalWrite(rDa,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rBa,HIGH);
 digitalWrite(rCa,HIGH);
 digitalWrite(rDa,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}

 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rDb,LOW);
 digitalWrite(rCa,LOW);
 digitalWrite(rDa,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rDb,HIGH);
 digitalWrite(rCa,HIGH);
 digitalWrite(rDa,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
}

 for(int i=0; i<time1; i++)
{
 
 digitalWrite(L1,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 
 digitalWrite(L2,HIGH);
 
 digitalWrite(bBc,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCb,LOW);
 
 digitalWrite(rDb,LOW);
 digitalWrite(rDc,LOW);
 digitalWrite(rDa,LOW);
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 
 digitalWrite(L3,LOW);
 
 digitalWrite(bBc,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCb,HIGH);
 
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDa,HIGH);
 
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW);
 
 digitalWrite(L4,LOW);
 
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);
 

}



}



do
{
 x++; 
  
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
  digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 digitalWrite(gAa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gBa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gBb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gBc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gBd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
  digitalWrite(gCa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gCb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gCc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gCd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gDa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gDb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gDc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(gDd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
  digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
 
 digitalWrite(bAa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bAb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bAc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bAd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bBa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bBb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bBc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bBd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
  digitalWrite(bCa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bCb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bCc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bCd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bDa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bDb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bDc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(bDd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);


 digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);


digitalWrite(rAa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rAb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rAc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rAd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rBa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rBb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rBc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rBd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
  digitalWrite(rCa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rCb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rCc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rCd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rDa,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rDb,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rDc,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 digitalWrite(rDd,LOW);
 digitalWrite(L1,HIGH);
 delay(time);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW); 
 delay(time);
 digitalWrite(L4,LOW);
 
 
}while (x<2);

 for(int i = 0; i<3 ; i++)
  {
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
  digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 
 
 
 
 
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 digitalWrite(L1,HIGH);
 delay(time2);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time2);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time2);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW);
 delay(time2);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 

 
 digitalWrite(bAa,LOW);
 digitalWrite(bAb,LOW);
 digitalWrite(bAc,LOW);
 digitalWrite(bAd,LOW);
 digitalWrite(bBa,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bBd,LOW); 
 digitalWrite(bCa,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCd,LOW); 
 digitalWrite(bDa,LOW);
 digitalWrite(bDb,LOW);
 digitalWrite(bDc,LOW);
 digitalWrite(bDd,LOW);
 
 digitalWrite(L1,HIGH);
 delay(time2);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time2);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time2);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW);
 delay(time2);
 digitalWrite(L4,LOW);
 
 digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 

 
 
 digitalWrite(rAa,LOW);
 digitalWrite(rAb,LOW);
 digitalWrite(rAc,LOW);
 digitalWrite(rAd,LOW);
 digitalWrite(rBa,LOW);
 digitalWrite(rBb,LOW);
 digitalWrite(rBc,LOW);
 digitalWrite(rBd,LOW); 
 digitalWrite(rCa,LOW);
 digitalWrite(rCb,LOW);
 digitalWrite(rCc,LOW);
 digitalWrite(rCd,LOW); 
 digitalWrite(rDa,LOW);
 digitalWrite(rDb,LOW);
 digitalWrite(rDc,LOW);
 digitalWrite(rDd,LOW);
 
 digitalWrite(L1,HIGH);
 delay(time2);
 digitalWrite(L2,HIGH);
 digitalWrite(L1,LOW);
 delay(time2);
 digitalWrite(L3,HIGH);
 digitalWrite(L2,LOW);
 delay(time2);
 digitalWrite(L4,HIGH);
 digitalWrite(L3,LOW);
 delay(time2);
 digitalWrite(L4,LOW);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
  }

 for(int i = 0; i<10 ; i++)
  {
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 
 for (int i = 0; i<time1; i++)
 
 {
 
  digitalWrite(L1,HIGH);
  digitalWrite(L4,HIGH);
   
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBd,LOW);
 digitalWrite(gBa,LOW); 
 digitalWrite(gCd,LOW);
 digitalWrite(gCa,LOW);
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
  digitalWrite(L1,LOW);
  digitalWrite(L4,LOW);
   
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gCd,HIGH);
 digitalWrite(gCa,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 digitalWrite(L2,HIGH);
 digitalWrite(L3,HIGH);
 
 digitalWrite(gAd,LOW);
 digitalWrite(gAa,LOW);
 digitalWrite(gDd,LOW);
 digitalWrite(gDa,LOW); 

 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 
 digitalWrite(gAd,HIGH);
 digitalWrite(gAa,HIGH);
 digitalWrite(gDd,HIGH);
 digitalWrite(gDa,HIGH);  
 }
 
  for (int i = 0; i<time1; i++)
 
 {
 
  digitalWrite(L1,HIGH);
  digitalWrite(L4,HIGH);
   
 digitalWrite(rAa,LOW);
 digitalWrite(rAb,LOW);
 digitalWrite(rAc,LOW);
 digitalWrite(rAd,LOW);
 digitalWrite(rBd,LOW);
 digitalWrite(rBa,LOW); 
 digitalWrite(rCd,LOW);
 digitalWrite(rCa,LOW);
 digitalWrite(rDa,LOW);
 digitalWrite(rDb,LOW);
 digitalWrite(rDc,LOW);
 digitalWrite(rDd,LOW); 
 
  digitalWrite(L1,LOW);
  digitalWrite(L4,LOW);
   
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBd,HIGH);
 digitalWrite(rCd,HIGH);
 digitalWrite(rCa,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH); 
 
 digitalWrite(L2,HIGH);
 digitalWrite(L3,HIGH);
 
 digitalWrite(rAd,LOW);
 digitalWrite(rAa,LOW);
 digitalWrite(rDd,LOW);
 digitalWrite(rDa,LOW); 

 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 
 digitalWrite(rAd,HIGH);
 digitalWrite(rAa,HIGH);
 digitalWrite(rDd,HIGH);
 digitalWrite(rDa,HIGH); 
 }

  
   for (int i = 0; i<time1; i++)
 
 {
 
  digitalWrite(L1,HIGH);
  digitalWrite(L4,HIGH);
   
 digitalWrite(bAa,LOW);
 digitalWrite(bAb,LOW);
 digitalWrite(bAc,LOW);
 digitalWrite(bAd,LOW);
 digitalWrite(bBd,LOW);
 digitalWrite(bBa,LOW); 
 digitalWrite(bCd,LOW);
 digitalWrite(bCa,LOW);
 digitalWrite(bDa,LOW);
 digitalWrite(bDb,LOW);
 digitalWrite(bDc,LOW);
 digitalWrite(bDd,LOW); 
 
  digitalWrite(L1,LOW);
  digitalWrite(L4,LOW);
   
 digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bCd,HIGH);
 digitalWrite(bCa,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH); 
 
 digitalWrite(L2,HIGH);
 digitalWrite(L3,HIGH);
 
 digitalWrite(bAd,LOW);
 digitalWrite(bAa,LOW);
 digitalWrite(bDd,LOW);
 digitalWrite(bDa,LOW); 

 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 
 digitalWrite(bAd,HIGH);
 digitalWrite(bAa,HIGH);
 digitalWrite(bDd,HIGH);
 digitalWrite(bDa,HIGH); 
 }
 
  
    for (int i = 0; i<time1; i++)
 
 {
 
  digitalWrite(L1,HIGH);
  digitalWrite(L4,HIGH);
   
 digitalWrite(bAa,LOW);
 digitalWrite(bAb,LOW);
 digitalWrite(bAc,LOW);
 digitalWrite(bAd,LOW);
 digitalWrite(bBd,LOW);
 digitalWrite(bBa,LOW); 
 digitalWrite(bCd,LOW);
 digitalWrite(bCa,LOW);
 digitalWrite(bDa,LOW);
 digitalWrite(bDb,LOW);
 digitalWrite(bDc,LOW);
 digitalWrite(bDd,LOW);
   
  
 
  digitalWrite(L1,LOW);
  digitalWrite(L4,LOW);
  
  digitalWrite(bBa,HIGH);   
 digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bCd,HIGH);
 digitalWrite(bCa,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 digitalWrite(bBd,HIGH);
 
 digitalWrite(L2,HIGH);
 digitalWrite(L3,HIGH);
 
 digitalWrite(bAd,LOW);
 digitalWrite(bAa,LOW);
 digitalWrite(bDd,LOW);
 digitalWrite(bDa,LOW); 

 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 
 digitalWrite(bAd,HIGH);
 digitalWrite(bAa,HIGH);
 digitalWrite(bDd,HIGH);
 digitalWrite(bDa,HIGH); 
 }
  }

 for(int i = 0; i<10 ; i++)
  {
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
  digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 for (int i = 0; i < time1; i++)
 {


 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);

digitalWrite(L1,HIGH);
digitalWrite(L2,HIGH);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH);
 
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH); 
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 digitalWrite(L1,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
  digitalWrite(L4,HIGH);
 
 digitalWrite(rAd,LOW);
 digitalWrite(rAa,LOW);
 digitalWrite(rDd,LOW);
 digitalWrite(rDa,LOW);
 
 digitalWrite(L4,LOW);
 
 digitalWrite(rAd,HIGH);
 digitalWrite(rAa,HIGH);
 digitalWrite(rDd,HIGH);
 digitalWrite(rDa,HIGH);
 
 
 }
 for (int i = 0; i < time1; i++)
 {


 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);

digitalWrite(L1,HIGH);
digitalWrite(L2,HIGH);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH);
 
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH); 
 
 digitalWrite(L1,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 digitalWrite(L2,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 


 
 
 } 
 
  for (int i = 0; i < time1; i++)
 {


 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);

digitalWrite(L1,HIGH);
digitalWrite(L2,HIGH);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH);
 
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH); 
 
 digitalWrite(L2,LOW);
 digitalWrite(L1,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 digitalWrite(L3,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
 }
 
 for (int i = 0; i < time1; i++)
 {


 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);

digitalWrite(L1,HIGH);
digitalWrite(L2,HIGH);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH);
 
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH); 
 
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L1,LOW);
 
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
  digitalWrite(L1,HIGH);
 
 digitalWrite(rAd,LOW);
 digitalWrite(rAa,LOW);
 digitalWrite(rDd,LOW);
 digitalWrite(rDa,LOW);
 
 digitalWrite(L1,LOW);
 
 digitalWrite(rAd,HIGH);
 digitalWrite(rAa,HIGH);
 digitalWrite(rDd,HIGH);
 digitalWrite(rDa,HIGH);
 
 
 } 
 
   for (int i = 0; i < time1; i++)
 {


 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);

digitalWrite(L1,HIGH);
digitalWrite(L2,HIGH);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH);
 
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH); 
 
 digitalWrite(L2,LOW);
 digitalWrite(L1,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 digitalWrite(L3,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
 }
 
 for (int i = 0; i < time1; i++)
 {


 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);

digitalWrite(L1,HIGH);
digitalWrite(L2,HIGH);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH);
 
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH); 
 
 digitalWrite(L1,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 digitalWrite(L2,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
 } 
  }
 
 for(int i = 0; i<10 ; i++)
  {
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
  digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 
 
 // Start animation

 digitalWrite(L1,HIGH);
 digitalWrite(L2,HIGH);
 digitalWrite(L3,HIGH);
 digitalWrite(L4,HIGH);
  
 digitalWrite(bAa,LOW);
 digitalWrite(bAb,LOW);
 digitalWrite(bAc,LOW);
 digitalWrite(bAd,LOW);
 
 delay(time3);
 
 digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 
 digitalWrite(bBa,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bBd,LOW); 
 
 delay(time3);
 
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
  
 digitalWrite(bCa,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCd,LOW); 
 
 delay(time3);
 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH);  
 
 digitalWrite(bDa,LOW);
 digitalWrite(bDb,LOW);
 digitalWrite(bDc,LOW);
 digitalWrite(bDd,LOW);
 
delay(time3);
 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 
 
 
 digitalWrite(rDa,LOW);
 digitalWrite(rDb,LOW);
 digitalWrite(rDc,LOW);
 digitalWrite(rDd,LOW);

delay(time3); 
 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rCa,LOW);
 digitalWrite(rCb,LOW);
 
 delay(time3);
 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rDc,HIGH);

 digitalWrite(rCc,LOW);
 digitalWrite(rBb,LOW);
 digitalWrite(rAa,LOW);
 
 delay(time3);
 
 digitalWrite(rCc,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rAa,HIGH);
 
 digitalWrite(rCd,LOW);
 digitalWrite(rBc,LOW);
 digitalWrite(rAc,LOW);
 
 delay(time3);
 
 digitalWrite(rCd,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rAc,HIGH); 
 
 digitalWrite(rAd,LOW);
 digitalWrite(rBd,LOW);
 digitalWrite(rCd,LOW); 
 digitalWrite(rDd,LOW); 
 
 delay(time3); 
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 
 

 digitalWrite(gAd,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCd,LOW); 
 digitalWrite(gDd,LOW);
 
 delay(time3);
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
 
 for(int i = 0; i<time3_1;i++)
 {
 


   
 digitalWrite(gAc,LOW);
 digitalWrite(gBc,LOW); 
 digitalWrite(gDc,LOW);
 digitalWrite(gCc,LOW);   
 
  digitalWrite(L1,HIGH);
digitalWrite(L2,HIGH);
digitalWrite(L3,LOW);
digitalWrite(L4,LOW);
 
  digitalWrite(gCc,HIGH);
 digitalWrite(gAc,HIGH); 
 digitalWrite(gDc,HIGH);
 digitalWrite(gBc,HIGH); 
    
 digitalWrite(L1,LOW);
digitalWrite(L2,LOW);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH); 
   
 digitalWrite(gAd,LOW);
 digitalWrite(gBd,LOW);
 digitalWrite(gCd,LOW);
 digitalWrite(gDd,LOW);  

 digitalWrite(L1,LOW);
digitalWrite(L2,LOW);
digitalWrite(L3,LOW);
digitalWrite(L4,LOW);  
   
  digitalWrite(gAd,HIGH);
 digitalWrite(gBd,HIGH);
 digitalWrite(gCd,HIGH);
 digitalWrite(gDd,HIGH);  
 
 
 }
 
  
 for(int i = 0; i<time3_1;i++)
 {

  digitalWrite(gAd,LOW);
  digitalWrite(gBd,LOW);  
  digitalWrite(gCd,LOW);
  digitalWrite(gDd,LOW); 
  
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,HIGH);
 
  digitalWrite(gAd,HIGH);
  digitalWrite(gBd,HIGH);  
  digitalWrite(gCd,HIGH);
  digitalWrite(gDd,HIGH); 
 
   digitalWrite(gBc,LOW);
   digitalWrite(gAc,LOW); 
   digitalWrite(gCc,LOW); 
   digitalWrite(gDc,LOW);
 
  digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,HIGH);
 digitalWrite(L4,LOW);   
   
   digitalWrite(gBc,HIGH);
   digitalWrite(gAc,HIGH); 
   digitalWrite(gCc,HIGH); 
   digitalWrite(gDc,HIGH);
  digitalWrite(gAb,LOW);  
    digitalWrite(gBb,LOW);
    digitalWrite(gCb,LOW);
    digitalWrite(gDb,LOW);
    
    
    digitalWrite(L1,LOW);
 digitalWrite(L2,HIGH);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);  
 
   digitalWrite(gAb,HIGH);  
    digitalWrite(gBb,HIGH);
    digitalWrite(gCb,HIGH);
    digitalWrite(gDb,HIGH);
    
   
   
 digitalWrite(gAa,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gCa,LOW);
 digitalWrite(gDa,LOW);


    digitalWrite(L1,HIGH);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);  
 
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
     digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);  
 
 
 }
  for(int i = 0; i<time3_1;i++)
 {
 
 
   digitalWrite(gAc,LOW);
 digitalWrite(gBc,LOW); 
 digitalWrite(gDc,LOW);
 digitalWrite(gCc,LOW);   
  digitalWrite(gAd,LOW);
 digitalWrite(gBd,LOW);
 digitalWrite(gCd,LOW);
 digitalWrite(gDd,LOW);  
 
  digitalWrite(L1,LOW);
digitalWrite(L2,LOW);
digitalWrite(L3,LOW);
digitalWrite(L4,HIGH);
 
  digitalWrite(gCc,HIGH);
 digitalWrite(gAc,HIGH); 
 digitalWrite(gDc,HIGH);
 digitalWrite(gBc,HIGH); 
  digitalWrite(gAd,HIGH);
 digitalWrite(gBd,HIGH);
 digitalWrite(gCd,HIGH);
 digitalWrite(gDd,HIGH);  
 
 
 digitalWrite(gAb,LOW);
 digitalWrite(gAa,LOW); 
 digitalWrite(gBb,LOW);
 digitalWrite(gBa,LOW);   
 digitalWrite(gCb,LOW);
 digitalWrite(gCa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDa,LOW);  
 
    
 digitalWrite(L1,LOW);
digitalWrite(L2,LOW);
digitalWrite(L3,HIGH);
digitalWrite(L4,HIGH); 

 digitalWrite(gAb,HIGH);
 digitalWrite(gAa,HIGH); 
 digitalWrite(gBb,HIGH);
 digitalWrite(gBa,HIGH);   
 digitalWrite(gCb,HIGH);
 digitalWrite(gCa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDa,HIGH);  
   


 digitalWrite(L1,LOW);
digitalWrite(L2,LOW);
digitalWrite(L3,LOW);
digitalWrite(L4,LOW);  
    
   
 }
 
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,HIGH);

  digitalWrite(gAa,LOW);
 digitalWrite(gAb,LOW);
 digitalWrite(gAc,LOW);
 digitalWrite(gAd,LOW);
 digitalWrite(gBa,LOW);
 digitalWrite(gBb,LOW);
 digitalWrite(gBc,LOW);
 digitalWrite(gBd,LOW); 
 digitalWrite(gCa,LOW);
 digitalWrite(gCb,LOW);
 digitalWrite(gCc,LOW);
 digitalWrite(gCd,LOW); 
 digitalWrite(gDa,LOW);
 digitalWrite(gDb,LOW);
 digitalWrite(gDc,LOW);
 digitalWrite(gDd,LOW); 
 
 delay(time3);
 
 digitalWrite(L1,LOW);
 digitalWrite(L2,LOW);
 digitalWrite(L3,LOW);
 digitalWrite(L4,LOW);

 
  digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
 
 
 
 
 
 
 
 
 digitalWrite(bAa,LOW);
 digitalWrite(bAb,LOW);
 digitalWrite(bAc,LOW);
 digitalWrite(bAd,LOW);
 digitalWrite(bBa,LOW);
 digitalWrite(bBb,LOW);
 digitalWrite(bBc,LOW);
 digitalWrite(bBd,LOW); 
 digitalWrite(bCa,LOW);
 digitalWrite(bCb,LOW);
 digitalWrite(bCc,LOW);
 digitalWrite(bCd,LOW); 
 digitalWrite(bDa,LOW);
 digitalWrite(bDb,LOW);
 digitalWrite(bDc,LOW);
 digitalWrite(bDd,LOW);
 
 digitalWrite(L4,HIGH);
 
 delay(time3);
 
 digitalWrite(L3,HIGH);
 digitalWrite(L4,LOW);
 
 delay(time3);
 
 digitalWrite(L2,HIGH);
 digitalWrite(L3,LOW);
 
 delay(time3);
 
 digitalWrite(L1,HIGH);
 digitalWrite(L2,LOW);
 
 delay(time3);
 
 digitalWrite(L1,LOW);
 
 delay(time3);
 
 
 digitalWrite(bAa,HIGH);
 digitalWrite(bAb,HIGH);
 digitalWrite(bAc,HIGH);
 digitalWrite(bAd,HIGH);
 digitalWrite(bBa,HIGH);
 digitalWrite(bBb,HIGH);
 digitalWrite(bBc,HIGH);
 digitalWrite(bBd,HIGH); 
 digitalWrite(bCa,HIGH);
 digitalWrite(bCb,HIGH);
 digitalWrite(bCc,HIGH);
 digitalWrite(bCd,HIGH); 
 digitalWrite(bDa,HIGH);
 digitalWrite(bDb,HIGH);
 digitalWrite(bDc,HIGH);
 digitalWrite(bDd,HIGH);
 
 
  
 digitalWrite(L1,HIGH); 
  
 digitalWrite(rAa,LOW);
 digitalWrite(rAb,LOW);
 digitalWrite(rAc,LOW);
 digitalWrite(rAd,LOW);
 digitalWrite(rBa,LOW);
 digitalWrite(rBb,LOW);
 digitalWrite(rBc,LOW);
 digitalWrite(rBd,LOW); 
 digitalWrite(rCa,LOW);
 digitalWrite(rCb,LOW);
 digitalWrite(rCc,LOW);
 digitalWrite(rCd,LOW); 
 digitalWrite(rDa,LOW);
 digitalWrite(rDb,LOW);
 digitalWrite(rDc,LOW);
 digitalWrite(rDd,LOW);
 
 delay(time3);
 
 digitalWrite(L1,LOW);
 
  digitalWrite(rAa,HIGH);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,HIGH);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,HIGH);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 
 
 for(int i = 0; i<time3_1+500;i++)
 
  {
    
    digitalWrite(L1,HIGH);
  
 digitalWrite(rAa,LOW);
 digitalWrite(rAb,LOW);
 digitalWrite(rAc,LOW);

 digitalWrite(rBa,LOW);
 digitalWrite(rBb,LOW);
 digitalWrite(rBc,LOW);

 digitalWrite(rCa,LOW);
 digitalWrite(rCb,LOW);
 digitalWrite(rCc,LOW);

 digitalWrite(rDa,LOW);
 digitalWrite(rDb,LOW);
 digitalWrite(rDc,LOW);

  
 digitalWrite(L2,HIGH); 
 

 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH); 
 
 
 digitalWrite(L2,LOW);  
  }
 
  for(int i = 0; i<time3_1+500;i++)
 
  {
    
    digitalWrite(L1,HIGH);
  
 digitalWrite(rAa,LOW);
 digitalWrite(rAb,LOW);


 digitalWrite(rBa,LOW);
 digitalWrite(rBb,LOW);


 digitalWrite(rCa,LOW);
 digitalWrite(rCb,LOW);


 digitalWrite(rDa,LOW);
 digitalWrite(rDb,LOW);


  
 digitalWrite(L2,HIGH); 
 digitalWrite(L3,HIGH);
 

 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH); 
 
 
 digitalWrite(L2,LOW); 
 digitalWrite(L3,LOW); 
  }
  
  delay(time3);
 
 digitalWrite(L1,HIGH);
 digitalWrite(L2,HIGH);
 digitalWrite(L3,HIGH);
 digitalWrite(L4,HIGH);
 
 digitalWrite(rAa,LOW);
 digitalWrite(rAb,HIGH);
 digitalWrite(rAc,HIGH);
 digitalWrite(rAd,HIGH);
 digitalWrite(rBa,LOW);
 digitalWrite(rBb,HIGH);
 digitalWrite(rBc,HIGH);
 digitalWrite(rBd,HIGH); 
 digitalWrite(rCa,LOW);
 digitalWrite(rCb,HIGH);
 digitalWrite(rCc,HIGH);
 digitalWrite(rCd,HIGH); 
 digitalWrite(rDa,LOW);
 digitalWrite(rDb,HIGH);
 digitalWrite(rDc,HIGH);
 digitalWrite(rDd,HIGH);
 

 delay(time3);
 
 digitalWrite(rAa,HIGH);
 digitalWrite(rBa,HIGH);
 digitalWrite(rCa,HIGH);
 digitalWrite(rDa,HIGH);
 
  digitalWrite(gAa,LOW);
  digitalWrite(gBa,LOW);
  digitalWrite(gCa,LOW);
  digitalWrite(gDa,LOW); 
 
delay(time3);

  digitalWrite(gCa,HIGH);
  digitalWrite(gDa,HIGH); 
 
  digitalWrite(gCb,LOW);
  digitalWrite(gDb,LOW); 
 
 delay(time3);
 
  digitalWrite(gBa,HIGH);
  digitalWrite(gCb,HIGH); 
  digitalWrite(gDb,HIGH);
  digitalWrite(gBb,LOW);
  digitalWrite(gCc,LOW);
  digitalWrite(gDd,LOW); 
  
delay(time3);

  digitalWrite(gBb,HIGH);
  digitalWrite(gCc,HIGH); 
  digitalWrite(gDd,HIGH);
   digitalWrite(gAb,LOW);
  digitalWrite(gBc,LOW);
  digitalWrite(gBd,LOW); 
  
 delay(time3);

   digitalWrite(gAb,HIGH);
  digitalWrite(gBc,HIGH); 
  digitalWrite(gBd,HIGH);
   digitalWrite(gAb,LOW);
  digitalWrite(gAc,LOW);
  digitalWrite(gAd,LOW); 
  
delay(time3); 
   
  
  
  
  
  
  
 
 
 
 digitalWrite(gAa,HIGH);
 digitalWrite(gAb,HIGH);
 digitalWrite(gAc,HIGH);
 digitalWrite(gAd,HIGH);
 digitalWrite(gBa,HIGH);
 digitalWrite(gBb,HIGH);
 digitalWrite(gBc,HIGH);
 digitalWrite(gBd,HIGH); 
 digitalWrite(gCa,HIGH);
 digitalWrite(gCb,HIGH);
 digitalWrite(gCc,HIGH);
 digitalWrite(gCd,HIGH); 
 digitalWrite(gDa,HIGH);
 digitalWrite(gDb,HIGH);
 digitalWrite(gDc,HIGH);
 digitalWrite(gDd,HIGH); 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  }




}















