content: 
  ===Writing===
  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''.
  Some of the twists that open the third book were used in the previous season's finale (mainly Robb's marriage and the White Walkers attacking the Night's Watch). Conversely, Barristan Selmy saving Daenerys from the manticore was borrowed from her last chapter in the second book ''A Clash of Kings''.