#Lutece0548. Cow IDs

Cow IDs

Migrated from Lutece 548 Cow IDs

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

Being a secret computer geek, Farmer John labels all of his cows with binary numbers. However, he is a bit superstitious, and only labels cows with binary numbers that have exactly KK 1 bits (1K101 \leq K \leq 10). The leading bit of each label is always a 1 bit, of course. FJ assigns labels in increasing numeric order, starting from the smallest possible valid label -- a KK-bit number consisting of all 1 bits. Unfortunately, he loses track of his labeling and needs your help: please determine the NthN_{th} label he should assign (1N1071 \leq N \leq 10^7).

Input

  • Line 11: Two space-separated integers, NN and KK.

Output

  • Line 11: Output the NthN_{th} label he should assign

Samples

输入数据 1

7 3

输出数据 1

10110

Resources

USACO Feb 2012