it is simple
suppose u are at pole then see the u,v,f . if they are in right side then u can take it +ve if they are in left then taken it -ve. and the formula is 1/F=1/U+1/V
when" u,v,and f "are at the right side of mirror than take +ve sign and when they are at left side then -ve sign should be taken and apply the formula
1/u + 1/v =1/f