5 | x z = 13 x 1 + 12 = 25
--------------
9 | y - 4 y = 9 x z + 8 = 9 x 25 + 8 = 233
--------------
13| z - 8 x = 5 x y + 4 = 5 x 233 + 4 = 1169
--------------
| 1 -12
585) 1169 (1
585
---
584
---
Therefore, on dividing the number by 585, remainder = 584.