#include <iostream>
using namespace std;
struct A { virtual ~A() = default; int a=1; };
struct B { virtual ~B() = default; int b=2; };
struct C : A, B { int c=3; };
void p(C* c) {
B* b = c;
cout << (void*)b << endl;
}
void r(C& c) {
B& b = c;
cout << (void*)&b << endl;
}
void pr(C* c) {
p(c);
r(*c);
}
int main() {
pr(nullptr);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IEEgeyB2aXJ0dWFsIH5BKCkgPSBkZWZhdWx0OyBpbnQgYT0xOyB9OwpzdHJ1Y3QgQiB7IHZpcnR1YWwgfkIoKSA9IGRlZmF1bHQ7IGludCBiPTI7IH07CnN0cnVjdCBDIDogQSwgQiB7IGludCBjPTM7IH07Cgp2b2lkIHAoQyogYykgewoJQiogYiA9IGM7Cgljb3V0IDw8ICh2b2lkKiliIDw8IGVuZGw7Cn0KCnZvaWQgcihDJiBjKSB7CglCJiBiID0gYzsKCWNvdXQgPDwgKHZvaWQqKSZiIDw8IGVuZGw7Cn0KCnZvaWQgcHIoQyogYykgewoJcChjKTsKCXIoKmMpOwp9CgppbnQgbWFpbigpIHsKCXByKG51bGxwdHIpOwp9Cg==