Can anybody answer this?

A teacher gives pens and pencils to elementary students at an equal rate.

Pencils 13 18 22 B
Pens 78 A 132 162

Determine the missing value for the letter B. 24 26 27 52