The resistor values are chosen in such a way that during the +½ cycle of the input, the output voltage = V(in) which is same in the -½ cycle of the input signal. There resistor values are calculated on the basis of gains of the amplifiers and their configurations.