#Lutece1833. 这是一道暴力题

这是一道暴力题

Migrated from Lutece 1833 这是一道暴力题

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给你nn种数字,请你找到一个由这些数字组成的一个最大的能被33整除的kk位数,如果不存在输出1-1

Input

第一行两个数n,k(1n10,1k1e5)n,k(1 \leq n \leq 10, 1\leq k \leq 1e5)
第二行有nn个互不相同的数字,范围[0,9][0,9]

Output

输出一行,最大的满足条件的数,不存在输出1-1

Samples

4 2
0 4 6 8
84

Note

输出的数不能存在前导0

Resources

每周一题 div 2