#include<iostream>
using namespace std;
class M
{
private:
int Q[2][3];
public:
friend M operator + (M& x, M& y);
friend ostream& operator<<(ostream& output, M& a);
friend istream& operator>>(istream& input, M& a);
};
M operator + (M& x, M& y)
{
M c;
int i, j;
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 3; j++)
{
c.Q[i][j] = x.Q[i][j] + y.Q[i][j];
}
}
return c;
}
ostream& operator<<(ostream& output, M& a)