#include <iostream>
using namespace std;

struct A {
  int a;
  A(int x);
  void print();
};

struct B : A {
  int b;
  B(int x, int y);
  void print();
};

struct C : B {
  int c;
  C(int x, int y, int z);
  void print();
};

A::A(int x):a(x) {
}

void A::print() {
  cout << a << endl;
}

B::B(int x, int y):A(x),b(y) {
}

void B::print() {
  A::print();
  cout << b << endl;
}

C::C(int x, int y, int z):B(x,y),c(z) {
}

void C::print() {
  B::print();
  cout << c << endl;
}

int main() {
  C c = {1,2,3};
  c.print();
  return 0;
}
