Snuke got an integer sequence from his mother, as a birthday present. The sequence has N elements, and the i-th of them is i. Snuke performs the following Q operations on this sequence. The i-th operation, described by a parameter q_i, is as follows:

* Take the first q_i elements from the sequence obtained by concatenating infinitely many copy of the current sequence, then replace the current sequence with those q_i elements.



After these Q operations, find how many times each of the integers 1 through N appears in the final sequence.

Constraints

* 1 ≦ N ≦ 10^5
* 0 ≦ Q ≦ 10^5
* 1 ≦ q_i ≦ 10^{18}
* All input values are integers.

Input

The input is given from Standard Input in the following format:


N Q
q_1
:
q_Q


Output

Print N lines. The i-th line (1 ≦ i ≦ N) should contain the number of times integer i appears in the final sequence after the Q operations.

Examples

Input

5 3
6
4
11


Output

3
3
3
2
0


Input

10 10
9
13
18
8
10
10
9
19
22
27


Output

7
4
4
3
3
2
2
2
0
0
#include<cstdio>
using namespace std;
typedef long long ll;
const int N=100100;
int i,j,k,n,m,ch,ff,qn;
ll t;
ll a[N],q[N],ans[N];
void R(ll &x) {
	ff=x=0;ch=getchar();
	while (ch<'0' || '9'<ch) { if (ch=='-') ff=1;ch=getchar();}
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
	if (ff) x=-x;
}
void W(ll x) {
	if (x<0) putchar('-'),x=-x;
	if (x>=10) W(x/10);
	putchar(x%10+'0');
}
int find(ll x) {
	int l=0,r=qn,mid;
	while (l<r) {
		mid=(l+r+1)>>1;
		if (q[mid]<=x) l=mid;
		else r=mid-1;
	}
	return l;
}
int main() {
	scanf("%d%d",&n,&m);
	q[++qn]=n;
	for (i=1;i<=m;i++) {
		R(t);
		while (qn && t<q[qn]) qn--;
		q[++qn]=t;
	}
	a[qn]=1;
	for (i=qn;i;i--) {
		ll t=q[i];
		int tt=i-1;
		while (t>q[1]) {
			a[tt]+=a[i]*(t/q[tt]);
			t=t%q[tt];
			tt=find(t);
		}
		ans[t]+=a[i];
	}
	for (i=n;i;i--) ans[i]+=ans[i+1];
	for (i=1;i<=n;i++) W(ans[i]),puts("");
}