#include<iostream>
#include<iomanip>
#include<functional>
#include<algorithm>
#include<string>
#include<vector>
#include<utility>
#include<tuple>
#include<map>
#include<set>
#include<queue>
#include<cmath>

using namespace std;
#define LL long long

int n,a[111111]={},sum=0;
int main() {
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		sum+=abs(a[i]-a[i-1]);
	}
	sum+=abs(a[n]);
	for(int i=1;i<=n;i++){
		int tmp=abs(a[i-1]-a[i+1])-abs(a[i]-a[i-1])-abs(a[i+1]-a[i]);
		cout<<sum+tmp<<endl;
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
using namespace std;

int main()
{
  int n;
  scanf("%d", &n);
  int S[n];
  for (int i = 0; i < n; i++)
  {
    scanf("%d", &S[i]);
  }
  int q;
  scanf("%d", &q);
  int T[q];
  for (int i = 0; i < q; i++)
  {
    scanf("%d", &T[i]);
  }
  int cnt = 0;
  for (int i = 0; i < q; i++)
  {
    for (int j = 0; j < n; j++)
    {
      if (S[j] == T[i])
      {
        cnt++;
        break;
      }
    }
  }

  printf("%d\n", cnt);
  return 0;
}
