>>1874969>my problem was the part you called "a bit of trial and error"Yeah, that's the part where you actually have to use some logic instead of purely mechanical manipulation of symbols.
ap = 1, so either a=1,p=1 or a=-1,p=-1.
Also, aq + bp = 0
So you know |b| = |q| = t, and that b and q have different signs.
cn = 12, so your options are factors of 12.
bn + qc = 1
tn - tc = 1
n+c=1/t
You know n+c is an integer, so 1/t has to be an integer, so t is either 1 or -1. Now you know that |b| = |q| = 1.
You also know that c and n are only 1 apart, so that suggests the factors 3 and 4.