Finding remainder when $(2023)^{2023}$ is divided by $35$
My Try: We need to find remainder when $(2023)^{2023}$ is divided by $5$ and $7$
So here $2023=0\mod(7)\Longrightarrow (2023)^{2023}=0\mod(7)$
And $\displaystyle (2023)=3\mod(5)\Longrightarrow (2023)^{2023}=3^{2023}\mod(5)$
$\displaystyle (3)^2=(-1)\mod(5)\Longrightarrow (9)^{1011}=-1\mod(5)$
$\displaystyle 3(9)^{1011}=-3\mod(5)=2\mod(5)$
So remainder when $(2023)^{2023}$ is divided by $35$ is $0$
Which is obtained by multiplying remainder of a number $(2023)^{2023}$ divisible by $5$ and $7$. But answer is $7$
What's wrong with my solution,Please explain me, Thanks