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.
2 8
12 20
2
0 4 
3 10
10 20 30
1
0 
5 10
20 16 4 16 2
5
0 2 4 6 8 
10 5
4 6 8 6 4 10 2 10 8 6
5
0 1 2 3 4 
20 25
15 10 5 20 10 5 15 5 15 10 15 5 5 5 5 10 15 20 20 20
5
0 5 10 15 20 
30 30
11 23 7 30 13 6 25 29 1 15 20 5 28 15 19 22 21 5 27 25 29 10 1 4 12 19 1 5 8 10
30
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 
40 30
16 12 12 22 18 28 32 24 36 26 12 30 22 16 32 30 36 18 20 16 12 24 28 20 16 28 8 34 18 18 18 4 4 36 18 10 30 38 18 10
15
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 
50 30
15 9 21 39 42 39 3 42 42 39 6 48 39 30 12 39 27 45 30 48 18 33 18 36 27 3 48 12 36 27 15 12 42 39 18 21 48 39 15 42 24 36 33 48 6 48 15 12 30 18
10
0 3 6 9 12 15 18 21 24 27 
1 10
1
10
0 1 2 3 4 5 6 7 8 9 
1 2
1
2
0 1 
60 30
10 30 45 15 25 60 10 40 35 25 5 40 35 40 15 5 15 35 10 60 25 15 60 10 30 10 5 25 10 15 60 20 30 5 50 50 40 20 55 40 35 15 15 10 60 40 50 50 30 15 25 45 35 40 15 5 5 20 60 45
6
0 5 10 15 20 25 
70 30
54 30 12 48 42 24 42 60 54 6 36 42 54 66 12 48 54 42 24 54 30 18 30 54 18 60 24 30 54 48 48 60 18 60 60 66 54 18 54 30 24 30 60 54 36 36 60 48 12 60 6 60 42 66 6 42 18 60 54 48 42 18 48 66 18 42 48 30 12 66
5
0 6 12 18 24 
80 30
30 80 40 40 60 60 40 80 70 80 30 30 60 80 30 70 60 10 10 30 70 60 70 20 40 20 30 10 60 70 70 50 60 70 70 30 70 60 60 70 20 60 10 60 70 80 20 30 30 20 60 50 40 40 80 70 70 20 40 80 30 50 40 10 40 20 70 10 80 10 50 40 50 70 40 80 10 40 60 60
3
0 10 20 
90 30
90 45 75 75 90 90 45 30 90 15 45 90 15 30 45 60 30 15 30 45 45 45 45 15 45 60 15 60 45 75 45 75 90 60 30 15 60 30 90 75 15 60 15 30 45 30 45 15 30 15 45 30 15 75 90 15 45 15 75 15 75 30 75 45 60 75 15 45 30 75 45 90 45 60 90 45 75 30 30 30 15 15 75 60 75 90 75 60 90 45
2
0 15 
100 30
30 30 30 90 30 30 90 90 30 90 30 90 90 30 30 30 60 60 60 30 30 60 90 90 90 60 30 90 60 60 90 60 60 60 30 60 60 60 60 90 60 30 60 90 90 90 60 60 90 60 60 60 60 30 30 60 30 60 60 90 30 60 60 60 90 60 90 30 30 60 30 90 90 90 90 60 90 30 30 60 60 30 60 60 60 30 90 60 60 60 90 60 30 90 60 30 30 60 90 90
1
0 
1 10
2
5
0 2 4 6 8 
1 10
3
10
0 1 2 3 4 5 6 7 8 9 
5 2
1 1 1 1 1
2
0 1 
2 30
6 10
15
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 
1 10
10
1
0 
1 10
20
1
0 
1 2
1000000000
1
0 
2 6
2 3
6
0 1 2 3 4 5 
1 5
4
5
0 1 2 3 4 
2 5
2 4
5
0 1 2 3 4 
3 30
6 10 15
30
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 
2 7
3 6
7
0 1 2 3 4 5 6 
2 15
3 5
15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
2 12
4 6
6
0 2 4 6 8 10 
2 10
3 6
10
0 1 2 3 4 5 6 7 8 9 
2 100000
2 4
50000
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 194 196 198 200 202 204 206 208 210 212 214 216 218 220 222 224 226 228 230 232 234 236 238 240 242 244 246 248 250 252 254 256 258 260 262 264 266 268 270 272 274 276 278...
1 14
4
7
0 2 4 6 8 10 12 
1 13
5
13
0 1 2 3 4 5 6 7 8 9 10 11 12 
2 420
412 363
420
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 ...
2 30
10 6
15
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 
1 5
3
5
0 1 2 3 4 
1 8
6
4
0 2 4 6 
3 10
6 6 6
5
0 2 4 6 8 
1 7
6
7
0 1 2 3 4 5 6 
1 9
6
3
0 3 6 
2 10
7 7
10
0 1 2 3 4 5 6 7 8 9 
1 8
5
8
0 1 2 3 4 5 6 7 
2 50
3 15
50
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 
1 6
4
3
0 2 4 
1 7
4
7
0 1 2 3 4 5 6 
1 10
7
10
0 1 2 3 4 5 6 7 8 9 
1 3
2
3
0 1 2 
2 10
2 5
10
0 1 2 3 4 5 6 7 8 9 
2 50
15 3
50
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 
1 5
2
5
0 1 2 3 4 
2 10
6 5
10
0 1 2 3 4 5 6 7 8 9 
2 35
5 7
35
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 
2 300
3 10
300
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 ...
1 100000
47
100000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 1...
2 54
6 9
18
0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 
from math import gcd
n, k = map(int, input().split())
a = set([int(x) % k for x in input().split()])
ans = k
for elem in a:
    ans = gcd(ans, elem)
print(k // ans)
print(*list(range(0, k, ans)))