If angles are complementary, then their sum is 90 degrees. If one angle is x, then the other is 90 - x. So, we know:
x = 5/3 (90 - x) - 54
x = 150 - 5/3 x - 54
x = 96 - 5/3 x
3x = 288 - 5x
8x = 288
x = 36 degrees
The other angle then is 90 - 36 = 54 degrees.
If angles are supplementary, their sum is 180 degrees. This time, let one angle = x and the other = 180 - x.
x = 8(180 - x) - 9
x = 1440 - 8x - 9
9x = 1431
x = 159 degrees, so the other angle is 180 - 159 = 21 degrees.