its walking tour day SISWinter t group student visit Torzhok Streets Torzhok narrow student row anotherinitially student angry Lets describe group student string capital letter a p a correspond angry student p correspond patient student such string describe row studentevery minute angry student throw snowball student formally angry student correspond character index string describe group throw snowball student correspond character index i1 student give student if target student angry angry even rightmost string student angry do not throw snowball themlet look example test the row initially look like PPAP then minute single angry student throw snowball student angry PPAA after student angryyour task help siswinter teacher determine moment student angry group