Measurement of the ratio B(t to Wb)/B(t to Wq) in pp collisions at sqrt(s) = 8 TeV