Let $p$ be an odd prime number less than $10^5$. Granite and Pomegranate play a game. First, Granite picks an integer $c \in \{2,3,\dots,p-1\}$. Pomegranate then picks two integers $d$ and $x$, defines $f(t) = ct + d$, and writes $x$ on a sheet of paper. Next, Granite writes $f(x)$ on the paper, Pomegranate writes $f(f(x))$, Granite writes $f(f(f(x)))$, and so on, with the players taking turns writing. The game ends when two numbers appear on the paper whose difference is a multiple of $p$, and the player who wrote the most recent number wins. Find the sum of all $p$ for which Pomegranate has a winning strategy.

Let's think step by step and output the final answer within \boxed{}.
user