As with many problems, it's a simple case of reading the documentation: MySQL Bit Functions.
But let's get some things straight here. Are these values intended to be bitmasks? If that's the case (and I'm sure it is), then B is equal to A | C, which is a tad odd. Typically, bitmasks work in the following way...
A = 0001
B = 0010
C = 0100
...etc.
In this way, you can combine values and have the bitmask account for multiple options, so the combination of A and C (A | C) would be 0101.
The whole purpose of a bitmask is that they can represent multiple values in a fixed-length string, so they're space efficient. The downside is that they don't make for human-readable output, unless you're used to looking at The Matrix!
On the other hand, I could be way off.
But, to get you going, I believe you are looking for the BIT_OR function: MySQL GROUP BY (Aggregate) Functions, which calculates and returns the bitwise OR of all bits in expr.