Converting Context-sensitive grammar to set notation

I have this context-sensitive grammar:

S -> XSY | a | b Xa -> aa Xb -> bb Y -> a I know what it does, as it always ends in a and is proceeded by 3 as or 3 bs. I’m just not sure how to write this in set notation and would appreciate any help. L={a^n,b^m | n ≥ 1 , 0 < m ≤ 3} Would it be something like this? (sorry don’t know latex)