local X=1 in

local X=2 in
local X=3 in
{Browse X} % (1)
end
end
{Browse X} % (2)
end

If we have the following code:

```lua
local X=1 in
local X=2 in
local X=3 in
{Browse X} % (1)
end
end
{Browse X} % (2)
end
```

Let's go through it step by step to understand what's happening.

1. First, the statement `local X=1` initializes a local variable `X` with a value of 1. This creates a new scope.

2. Next, we encounter another `local X=2` statement. This initializes a new local variable `X` with a value of 2. Since this is a nested scope, it shadows the previous `X` variable from the outer scope.

3. Similarly, we have a third `local X=3` statement, which initializes another local variable `X` with a value of 3. This also shadows the previous `X` variable from the outer scope.

4. Within the innermost scope, we have the statement `{Browse X}`. The `Browse` command is used to display the value of a variable, and in this case, it displays the value of `X` which is 3. Note that this is the value of the variable in the current scope.

5. The innermost scope ends with the `end` keyword, which signifies the end of the nested scopes. After this, the `X` variable from the outermost scope (which had a value of 1) becomes accessible again.

6. Continuing to the next `Browse X` statement, we see that it displays the value of `X` which is 2. This is the value of the variable in the outer scope, since the previous shadowing inner scopes have ended.

7. Finally, the outermost scope ends with the last `end` keyword.

So, the output of this code will be:
```
3
2
```