Making reference to a variable - begin repeat

What is the problem? Please be detailed.

I have 3 variables in a begin repeat group:
Var1(select-one ww); ww : A, B, and C
Var2(select_one xx); xx: 1, 2 , 3, 4,5, and 6.
and var3(text)
I need to return the first and last time var2 items 3,4 and 5 options are are selected to act
it does not matter matter if the option is selected twice. it just have to be the the first time and last time .
I have tried my limited knowledge with index-repeat but it keeps failing.
I needed this help like yesterday

attached is theNeotesting.xlsx (11.7 KB)
file