#include <iostream>
using namespace std;

class three_d {
	int x, y, z;
public:
	three_d(int i, int j, int k)
	{
		x = i;y = j; z = k;
	}
	three_d(){ x = z = y = 0;}
	void get(int &i, int &j, int &k)
	{
		i = x;j = y;k = z;
	}
	three_d operator+(three_d &ob);
	three_d operator-(three_d &ob);
	friend three_d operator++(three_d &ob);
	friend three_d operator--(three_d &ob);	
};

three_d three_d::operator+(three_d &ob)
{
	three_d temp;
	temp.x = x + ob.x;
	temp.y = y + ob.y;
	temp.z = z + ob.z;
	return temp;
}

three_d three_d::operator-(three_d &ob)
{
	three_d temp;
	temp.x = x - ob.x;
	temp.y = y - ob.y;
	temp.z = z - ob.z;
	return temp;
}
three_d operator++(three_d &ob)
{
	ob.x++;
	ob.y++;
	ob.z++;
	return ob;
}
three_d operator--(three_d &ob)
{
	ob.x--;
	ob.y--;
	ob.z--;
	return ob;
}
void print(three_d ob)
{
	int x,y,z;
	ob.get(x,y,z);
	cout << x << ',' << y << ',' << z << "\n";
}

int main()
{
	three_d a(10,5,15),b(1,1,2);
	print(a);
	++a;
	print(a);
	three_d c = a + b;
	print(c);
	--c;
	print(c);
	c = a-b;
	print(c);
	
	return 0;
}