# include<iostream>
#include<string>
using namespace std;
class Ba{
public:
Ba(int a,int b){
this->a=a;
this->b=b;
}
int show();
protected:
int a;
int b;
};
int Ba::show(){
return a+b;
}
class B:public Ba{
public:
int print();
B(int a,int b,int c);
private:
int c;
};
B::B(int a,int b,int c):Ba(a,b){
this->c=c;
}
int B::print(){
return a+b+c;
}
int main(){
int a;
int b;
int c;
cin>>a>>b>>c;
Ba ba(a,b);
B s(a,b,c);
cout<<ba.show()<<endl;
cout<<s.print()<<endl;
cout<<s.show()<<endl;
return 0;
}