#include<cstdio>
using namespace std;
int x[10000]={0},y[100000]={0};
int main()
{
freopen("asm_command.in","r",stdin);
freopen("asm_command.out","w",stdout);
int n,q;
scanf("%d%d",&n,&q);
for (int i=1;i<=n;i++)
y[i]=i;
for (int i=1;i<=q;i++)
{
int w;
scanf("%d",&w);
if (w==0)
{
int e;
scanf("%d",&e);
printf("%.1lf %.1lf\n",double(x[e]),double(y[e]));
}
if (w==1)
{
int beg,end,dx,dy;
scanf("%d%d%d%d",&beg,&end,&dx,&dy);
for (int j=beg;j<=end;j++)
{
x[j]=x[j]+dx;
y[j]=y[j]+dy;
}
}
}
}