What was the first foreign ruling dynasty of Egypt