#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<sstream>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<cmath>
#include<stack>
#include<set>
#include<map>
#define rep(i,x,n) for(int i=x;i<=n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
#define sz(a) int(a.size())
#define rson mid+1,r,p<<1|1
#define pii pair<int,int>
#define lson l,mid,p<<1
#define ll long long
#define pb push_back
#define mp make_pair
#define se second
#define fi first
using namespace std;
const double eps=1e-8;
const int mod=1e9+7;
const int N=2e5+10;
const int inf=1e9;
int n,m;
ll a[N],b[N];
ll gcd(ll a,ll b){
  return b==0?a:gcd(b,a%b);
}
int main(){
  ios::sync_with_stdio(false);
  //freopen("in","r",stdin);
  cin>>n>>m;
  rep(i,1,n){
    cin>>a[i];
  }
  sort(a+1,a+n+1);
  ll d=0;
  rep(i,1,n-1){
    d=gcd(d,a[i+1]-a[i]);
  }
  rep(i,1,m){
    cin>>b[i];
    cout<<gcd(d,a[1]+b[i])<<' ';
  }
  cout<<endl;
  return 0;
}
### Prompt

In cpp, your task is to solve the following problem:

You are given two positive integer sequences a_1, …, a_n and b_1, …, b_m. For each j = 1, …, m find the greatest common divisor of a_1 + b_j, …, a_n + b_j.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 2 ⋅ 10^5).

The second line contains n integers a_1, …, a_n (1 ≤ a_i ≤ 10^{18}).

The third line contains m integers b_1, …, b_m (1 ≤ b_j ≤ 10^{18}).

Output

Print m integers. The j-th of them should be equal to GCD(a_1 + b_j, …, a_n + b_j).

Example

Input


4 4
1 25 121 169
1 2 7 23


Output


2 3 8 24

### Response

```cpp
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<sstream>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<cmath>
#include<stack>
#include<set>
#include<map>
#define rep(i,x,n) for(int i=x;i<=n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
#define sz(a) int(a.size())
#define rson mid+1,r,p<<1|1
#define pii pair<int,int>
#define lson l,mid,p<<1
#define ll long long
#define pb push_back
#define mp make_pair
#define se second
#define fi first
using namespace std;
const double eps=1e-8;
const int mod=1e9+7;
const int N=2e5+10;
const int inf=1e9;
int n,m;
ll a[N],b[N];
ll gcd(ll a,ll b){
  return b==0?a:gcd(b,a%b);
}
int main(){
  ios::sync_with_stdio(false);
  //freopen("in","r",stdin);
  cin>>n>>m;
  rep(i,1,n){
    cin>>a[i];
  }
  sort(a+1,a+n+1);
  ll d=0;
  rep(i,1,n-1){
    d=gcd(d,a[i+1]-a[i]);
  }
  rep(i,1,m){
    cin>>b[i];
    cout<<gcd(d,a[1]+b[i])<<' ';
  }
  cout<<endl;
  return 0;
}
```