Note that 1111 is not divisible by 3, so it follows that [tex](1111,9)=1[/tex] (they are coprime). Given that [tex]\varphi(9)=6[/tex], where [tex]\varphi[/tex] is the Euler totient/phi function, and that
[tex]2222=6(370)+2[/tex]
we can then write
[tex]1111^{2222}\equiv1111^{2+6(370)}\equiv1111^2(1111^6)^{370}\mod9[/tex]
By Euler's theorem, we have
[tex]1111^{\varphi(9)}\equiv1111^6\equiv1\mod9[/tex]
and so
[tex]1111^{2222}\equiv1111^2\mod9[/tex]
Note that
[tex]1111\equiv9(123)+4\equiv4\mod9[/tex]
which means
[tex]1111^{2222}\equiv1111^2\equiv4^2\equiv16\equiv7\mod9[/tex]
so [tex]n=7[/tex].