UNIT 5 assessment 3 question 8

I need help understanding this question

x<- 0
repeat _until (x=3) {
y<-0
x<- x+1
repeat_until (y=3) {
y<- y+1
display (x,y)
}
}

I see the pattern in the answer description as
1,1
1, 2
2,1
2,2

When I try to solve it myself, I do under 1,1 and even 1,2 if I stay inside the loop for y but then 2,1 and 2,2, I get lost how that pattern comes about. help please! I want to review this exam with my students and this is a highly missed question already today.

I hope this helps…

x <- 0
REPEAT_UNTIL( x = 3 ){ <----Loop1
y <- 0
x <- x+1
REPEAT_UNTIL ( y = 3 ){ <-----Loop2
y <- y+1
DISPLAY( x + ", " + y)
}
}

As we enter Loop1 the first time X is 0. Inside Loop1 y is set to 0 and X is set to 1. Loop2 then executes.
First time in the loop2:
Y set to 1 and “1, 1” is displayed

Second time through Loop2:
Y is set to 2 and “1, 2” is displayed

Third time through Loop2:
Y is set to 3 and “1, 3” is displayed

Y is 3 so Loop2 terminates.

Second time through Loop1:
Y is set back to 0
X is set to 2
First time in the loop2:
Y set to 1 and “2, 1” is displayed

Second time through Loop2:
Y is set to 2 and “2, 2” is displayed

Third time through Loop2:
Y is set to 3 and “2, 3” is displayed

Y is 3 so Loop2 terminates.

Third time through Loop1:
Y is set back to 0
X is set to 3
First time in the loop2:
Y set to 1 and “3, 1” is displayed

Second time through Loop2:
Y is set to 2 and “3, 2” is displayed

Third time through Loop2:
Y is set to 3 and “3, 3” is displayed

Y is 3 so Loop2 terminates.

X is 3 so Loop1 terminates.

So the outputs were:
1, 1
1, 2
1, 3
2, 1
2, 2
2, 3
3, 1
3, 2
3, 3

Yes, this helped tremendously. Thank you so much!