#include <iostream>
using namespace std;
class CBank
{
private:
int balance;
public:
CBank(int);
friend int total(CBank& k, BBank& l, GBank& j);
int get_val()
{
return balance;
}
};
CBank::CBank(int a)
{
balance = a;
}
class BBank
{
private:
int balance;
public:
BBank(int);
friend int total(CBank& k, BBank& l, GBank& j);
int get_val()
{
return balance;
}
};
BBank::BBank(int b)
{
balance = b;
}
class GBank
{
private:
int balance;
public:
GBank(int);
friend int total(CBank& k, BBank& l, GBank& j);
int get_val()
{
return balance;
}
};
GBank::GBank(int c)
{
balance = c;
};
int total(CBank& k, BBank& l, GBank& j)
{
int s;
s = k.get_val() + l.get_val() + j.get_val();
return s;
}
int main()
{
int x;
CBank a1(1234); BBank a2(9823); GBank a3(7255);
x = total(a1, a2, a3);
cout << x << endl;
return 0;
}