Let the two numbers be x and y, where x being the greater one.
Then according to the question,
x−y=8 ....(1) and x+12=3y ..(2)
From ..(2),
x=3y−12
Putting this in the ...(1)
3y−12−y=8
2y=12+8=20
∴y=10
From ...(1)
x−10=8
x=8+10
∴x=18
Therefore, the numbers are 18 and 10