A Storm of Swords
The episode was written by showrunners David Benioff and D. B. Weiss. It was based mainly on the first chapters of "A Storm of Swords", the third novel in George R. R. Martin's "A Song of Ice and Fire" series. Specifically, it adapts material from chapters Samwell I, Jon I, Davos I, Davos II, Tyrion I, Daenerys I, Davos III, and Daenerys II from "A Storm of Swords" and chapter Daenerys V of "A Clash of Kings".