Happiness is Mandatory If you're sad, that's wrong. We need to scrub out ALL sadness.

This is a sad face, for reference:

  ......  
  .S..S.  
 ........ 
 ...SS... 
..SS..SS..
.S......S.
 ........ 


Where S is a consistent pixel, . is any pixel other than S, and   is any pixel. Note that the sad face is not a perfect square, only the . should be considered. Theoretical sad face overlap in the corners is possible, but overwriting one sad face has a chance to eliminate the other, e.g. if it was in a . character and is overwritten with an S.

Input

An image, in any acceptable format. I would recommend a color matrix.

Output

The same image, but take all those treasonous sad faces and replace their S characters with randomized data. The data should be either random RGB values, or values taken from the palette of the image. You just need to have a nonzero probability of all outputs; you do not need to make it uniform.

Rules


S can be any pixel, as long as it's the same pixel throughout the formation.
Remove ALL sad faces. If the removal makes a new sad face, then remove that too.
You should only modify S pixels. Unauthorized modification of pixels is insubordination, punishable by disqualification.
The shortest answer in bytes wins.


Test Cases

These have one sad face each:






This has 2 sad faces, on the left and right:



This has 2 sad faces overlapping:



This has 2 sad faces, in the top-left and bottom-right; the bottom-left and top-right have S characters in the place of . characters:
C (gcc), 339 337 331  323 bytes


Saved two eight fifteen sixteen bytes thanks to ceilingcat.




C,a,l,A,m,i,t,o,u,s;n(e,z,Z)int*e;{for(C=1;C;C+=i)for(C=s=0;s&lt;Z;s++)for(u=0;u&lt;z;u++)if(u&gt;8&amp;s&gt;5)for(m=e[~-u+~-s*z],A=i=1;++A&lt;4;)for(o=0;o&lt;7;o++)for(t=0;t&lt;10;t++)a=e[l=u+t-9+(s+o-6)*z],(o-1||t-3&amp;&amp;t-6)*(o-3||t&lt;4|5&lt;t)*(o-4||t&lt;2|3&lt;t&amp;t&lt;6|7&lt;t)*(o-5||t-1&amp;&amp;t-8)?o&gt;1|t&gt;1&amp;t&lt;8&amp;o&lt;2|o&gt;3&amp;o&lt;6|t&amp;&amp;t&lt;9&amp;&amp;(i*=a-m):A&lt;3?i*=a==m:i?e[l]=rand():e;}


Try it online!