  We show that for every two cycles $C,D$, there exists $c>0$ such that if $G$
is both $C$-free and $\overline{D}$-free then $G$ has a clique or stable set of
size at least $|G|^c$. ("$H$-free" means with no induced subgraph isomorphic to
$H$, and $\overline{D}$ denotes the complement graph of $D$.) Since the
five-vertex cycle $C_5$ is isomorphic to its complement, this extends the
earlier result that $C_5$ satisfies the Erd\H{o}s-Hajnal conjecture. It also
unifies and strengthens several other results.
  The results for cycles are special cases of results for subdivisions, as
follows. Let $H,J$ be obtained from smaller graphs by subdividing every edge
exactly twice. We will prove that there exists $c>0$ such that if $G$ is both
$H$-free and $\overline{J}$-free then $G$ has a clique or stable set of size at
least $|G|^c$. And the same holds if $H$ and/or $J$ is obtained from a graph
bychoosing a forest $F$ and subdividing every edge not in $F$ at least five
times. Our proof uses the framework of iterative sparsification developed in
other papers of this series.
  Along the way, we will also give a short and simple proof of a celebrated
result of Fox and Sudakov, that says that for all $H$, every $H$-free graph
contains either a large stable set or a large complete bipartite subgraph.
