Border

题意翻译

$Natasha $ 抵达了火星. 火星上的钞票面额有$n$种,第$i$种的价值是$a_i$。$Natasha $ 每个面额的钞票都有无数张。 火星人有$k$个手指,所以他们使用$k$进制。此外,火星人认为数字$d$(在$k$进制中)是神圣的。因此,如果凑出来的钱中在$k$进制中最后一位数字是$d$,火星人会很高兴。不幸的是,$Natasha $ 还不知道$d$是几。所以,他想知道他能凑出哪些数字。

题目描述

Astronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the planet. Natasha is the inhabitant of Earth, therefore she had to pay the tax to enter the territory of Mars. There are $ n $ banknote denominations on Mars: the value of $ i $ -th banknote is $ a_i $ . Natasha has an infinite number of banknotes of each denomination. Martians have $ k $ fingers on their hands, so they use a number system with base $ k $ . In addition, the Martians consider the digit $ d $ (in the number system with base $ k $ ) divine. Thus, if the last digit in Natasha's tax amount written in the number system with the base $ k $ is $ d $ , the Martians will be happy. Unfortunately, Natasha does not know the Martians' divine digit yet. Determine for which values $ d $ Natasha can make the Martians happy. Natasha can use only her banknotes. Martians don't give her change.

输入输出格式

输入格式


The first line contains two integers $ n $ and $ k $ ( $ 1 \le n \le 100\,000 $ , $ 2 \le k \le 100\,000 $ ) — the number of denominations of banknotes and the base of the number system on Mars. The second line contains $ n $ integers $ a_1, a_2, \ldots, a_n $ ( $ 1 \le a_i \le 10^9 $ ) — denominations of banknotes on Mars. All numbers are given in decimal notation.

输出格式


On the first line output the number of values $ d $ for which Natasha can make the Martians happy. In the second line, output all these values in increasing order. Print all numbers in decimal notation.

输入输出样例

输入样例 #1

2 8
12 20

输出样例 #1

2
0 4 

输入样例 #2

3 10
10 20 30

输出样例 #2

1
0 

说明

Consider the first test case. It uses the octal number system. If you take one banknote with the value of $ 12 $ , you will get $ 14_8 $ in octal system. The last digit is $ 4_8 $ . If you take one banknote with the value of $ 12 $ and one banknote with the value of $ 20 $ , the total value will be $ 32 $ . In the octal system, it is $ 40_8 $ . The last digit is $ 0_8 $ . If you take two banknotes with the value of $ 20 $ , the total value will be $ 40 $ , this is $ 50_8 $ in the octal system. The last digit is $ 0_8 $ . No other digits other than $ 0_8 $ and $ 4_8 $ can be obtained. Digits $ 0_8 $ and $ 4_8 $ could also be obtained in other ways. The second test case uses the decimal number system. The nominals of all banknotes end with zero, so Natasha can give the Martians only the amount whose decimal notation also ends with zero.