#include<iostream.h>
class A
{
 protected:
   int a;
 public:
   void set(int x);
};
void A::set(int x)
{
   a=x;
}
class B:virtual public A
{
 protected:
   int b;
};
class C:virtual public A
{
 protected:
   int c;
};
class D:public B,public C
{
 private:
   int a;
 public:
   void set(int x);
   void display(void);
};
void D::set(int x)
{
  a=x;
  b=x+1;
  c=x+2;
}
void D::display(void)
{
   cout<<"A::a="<<A::a<<endl;
   cout<<"a="<<a<<" b="<<b<<" c="<<c<<endl;
}
int main()
{
   D s;
   s.set(1); 
   s.A::set(4);
   s.display();  
   return(0);
}
