int wait(int milisek )
{
  long zaderzhka;
  zaderzhka = millis();
  while (millis() - milisek < zaderzhka)
  {
  }
}

void setup() {
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(4, HIGH); 
  wait(3000);
  digitalWrite(4, LOW);
  wait(3000);
  digitalWrite(5, HIGH); 
  wait(400);
  digitalWrite(5, LOW);
  wait(400);
    digitalWrite(6, HIGH); 
  wait(500);
  digitalWrite(6, LOW);
  wait(500);
}