a + b = 13.....a = 13 - b
18a + 22b = 258
18(13 - b) + 22b = 258
234 - 18b + 22b = 258
-18b + 22b = 258 - 234
4b = 24
b = 24/4
b = 6.........so there were 6 tour packages from package B sold
a + b = 13
a + 6 = 13
a = 13 - 6
a = 7.....and there were 7 tour packages from package A sold