Picture operator&(const Picture& p, const Picture& q)
{
	Picture r;
	r.init(p.height + q.height, Picture::max(p.width ,q.width));
	r.clear(0,p.width,p.height,r.width);
	r.clear(p.height,q.width,r.height,r.width);	
	r.copyblock(0,0,p);
	r.copyblock(p.height,0,q);
	return r;
}
Picture operator|(const Picture& p, const Picture& q)
{
	Picture r;
	r.init(Picture::max(p.height,q.height),p.width + q.width);
	r.clear(p.height,0,r.height,q.width);
	r.clear(q.height,p.width,r.height,r.width);
	r.copyblock(0,0,p);
	r.copyblock(0,p.width,q);
	return r;
}
Picture frame(const Picture& p)
{
	Picture r;
	r.init(p.height + 2, p.width + 2);
	for(int i = 1; i < r.height -1; ++i)
	{
		r.position(i,0) = '|';
		r.position(i, r.width - 1) = '|';
	}
	for(int j = 1; j < r.width - 1; ++j)
	{
		r.position(0, j) = '-';
		r.position(r.height - 1, j) = '-';
	}
	r.position(0, 0) = '+';
	r.position(0, r.width-1) = '+';
	r.position(r.height-1, 0)= '+';
	r.position(r.height-1,r.width-1)='+';
	r.copyblock(1,1,p);
	return r;
}