# Quagdonic numbers

### Definition

A number ${\displaystyle n\in \mathbb {N} ,n\geq 1}$ is ${\displaystyle m}$-quagdonic (${\displaystyle m\in \mathbb {N} ,m\geq 2}$) iff there exists ${\displaystyle k\in \mathbb {N} ,k\leq \left\lfloor \log _{m}n\right\rfloor }$ such that

${\displaystyle \prod _{i=k}^{\left\lfloor \log _{m}n\right\rfloor }\left(\left\lfloor m^{-i}n\right\rfloor {\bmod {m}}\right)=\left(n{\bmod {m}}^{k}\right)}$

### Syntax

Source code consists of integers ${\displaystyle m}$ and ${\displaystyle n}$, respectively, separated by space.

The output are the first ${\displaystyle n}$ ${\displaystyle m}$-quagdonic numbers, separated by spaces.

### Example

Input: 10 200

Output:

11 22 33 44 55 66 77 88 99 100 101 111 122 133 144 155 166 177 188 199 200 202 212 224 236 248
300 303 313 326 339 400 404 414 428 500 505 515 600 606 616 700 707 717 800 808 818 900 909 919
1000 1001 1010 1020 1030 1040 1050 1060 1070 1080 1090 1100 1101 1111 1122 1133 1144 1155 1166
1177 1188 1199 1200 1202 1212 1224 1236 1248 1300 1303 1313 1326 1339 1400 1404 1414 1428 1500
1505 1515 1600 1606 1616 1700 1707 1717 1800 1808 1818 1900 1909 1919 2000 2002 2010 2020 2030
2040 2050 2060 2070 2080 2090 2100 2102 2112 2124 2136 2148 2200 2204 2214 2228 2300 2306 2316
2400 2408 2418 2500 2510 2600 2612 2700 2714 2800 2816 2900 2918 3000 3003 3010 3020 3030 3040
3050 3060 3070 3080 3090 3100 3103 3113 3126 3139 3200 3206 3216 3300 3309 3319 3400 3412 3500
3515 3600 3618 3700 3721 3800 3824 3900 3927 4000 4004 4010 4020 4030 4040 4050 4060 4070 4080
4090 4100 4104 4114 4128 4200 4208 4218 4300 4312 4400 4416 4500 4520 4600 4624 4700