#include <iostream>

using namespace std;

class A {
  public:
    int x = 1;
};

class B : public A {
  public:
    int x = 2;  // try out without it
    int getx() {
        x++;
        return A::x;
    }
};

int main() {
    A a;
    B b;

//    a.x = 1;
//    b.x = 2;
    
    cout << "a.x      = " << a.x << endl;
    cout << "b.x      = " << b.x << endl;
    cout << "b.getx() = " << b.getx() << endl;
    cout << "b.x      = " << b.x << endl;
}
