#include <bits/stdc++.h>
#define debug freopen("in.txt","r",stdin);freopen("out.txt","w",stdout)
using namespace std;
int n;
int x[105];
int y[105];
int num[210];
void work()
{
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&x[i]);
for(int i=1;i<=n;i++) scanf("%d",&y[i]);
for(int i=1;i<=n;i++)
num[x[i]-y[i]+100];
for(int i=0;i<=200;i)
{
if(!num[i]) continue;
printf("%d %d\n",i-100,num[i]);
}
}
int main()
{
//debug;
work();
return 0;
}