One Martian boy called Zorg wants to present a string of beads to his friend from the Earth — Masha. He knows that Masha likes two colours: blue and red, — and right in the shop where he has come, there is a variety of adornments with beads of these two colours. All the strings of beads have a small fastener, and if one unfastens it, one might notice that all the strings of beads in the shop are of the same length. Because of the peculiarities of the Martian eyesight, if Zorg sees one blue-and-red string of beads first, and then the other with red beads instead of blue ones, and blue — instead of red, he regards these two strings of beads as identical. In other words, Zorg regards as identical not only those strings of beads that can be derived from each other by the string turnover, but as well those that can be derived from each other by a mutual replacement of colours and/or by the string turnover.

It is known that all Martians are very orderly, and if a Martian sees some amount of objects, he tries to put them in good order. Zorg thinks that a red bead is smaller than a blue one. Let's put 0 for a red bead, and 1 — for a blue one. From two strings the Martian puts earlier the string with a red bead in the *i*-th position, providing that the second string has a blue bead in the *i*-th position, and the first two beads *i* - 1 are identical.

At first Zorg unfastens all the strings of beads, and puts them into small heaps so, that in each heap strings are identical, in his opinion. Then he sorts out the heaps and chooses the minimum string in each heap, in his opinion. He gives the unnecassary strings back to the shop assistant and says he doesn't need them any more. Then Zorg sorts out the remaining strings of beads and buys the string with index *k*. 

All these manupulations will take Zorg a lot of time, that's why he asks you to help and find the string of beads for Masha.
The input file contains two integers *n* and *k* (2 ≤ *n* ≤ 50;1 ≤ *k* ≤ 10<sup class="upper-index">16</sup>) —the length of a string of beads, and the index of the string, chosen by Zorg.
Let's consider the example of strings of length 4 — 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110. Zorg will divide them into heaps: {0001, 0111, 1000, 1110}, {0010, 0100, 1011, 1101}, {0011, 1100}, {0101, 1010}, {0110, 1001}. Then he will choose the minimum strings of beads in each heap: 0001, 0010, 0011, 0101, 0110. The forth string — 0101.
4 4
0101
2 1
01
2 2
-1
3 1
001
3 2
010
3 3
-1
4 1
0001
4 2
0010
4 3
0011
4 4
0101
4 5
0110
4 6
-1
5 1
00001
5 2
00010
5 3
00011
5 4
00100
5 5
00101
5 6
00110
5 7
01001
5 8
01010
5 9
01110
5 10
-1
6 1
000001
6 2
000010
6 3
000011
6 4
000100
6 5
000101
6 6
000110
6 7
000111
6 8
001001
6 9
001010
6 10
001011
6 11
001100
6 12
001101
6 13
001110
6 14
010001
6 15
010010
6 16
010101
6 17
010110
6 18
011001
6 19
011110
6 20
-1
7 15
0010001
8 38
00101011
9 122
010110110
10 204
0100001001
11 233
00100000110
12 838
010001101110
13 1395
0011011100001
15 7182
010100100010110
49 40394027154620
0001001111101011001111110101110100100000001011001
49 60751526478082
0001111110000000110111111000011100100101011101101
49 47052263674145
0001011110010000111110011010010011001001000001110
49 112040518472135
0100011000110011010111000100101001100101110010010
49 51848130384485
0001101001000110010000111010110110011111010000011
49 125654751631398
0101011000011000110101000100101001000001111011001
49 36309684494664
0001000110111101110000010011001100010001010001001
49 130173238599396
0101110011101110010011111111010101001011111101001
49 1277796700834
0000000010010101000110000010001111111010111011010
49 140149194635018
0111011110111001011010110100111001100100111000001
50 250144743882708
01010101010010111011000010110101001100000110000101
50 107064605474749
00011011001111100010010111111110001010101001100010
50 57129577186267
00001101101110011100010111101100101101111110100110
50 161245081749292
00101100010110000001101000110001001101000011000011
50 48522499712553
00001011100011011110000110010110011001011100111011
50 264823400156610
01100000110111100000001000001110010101010011111110
50 5176185247152
00000001001011101011000100010001010111011000010101
50 280853334157361
01111001111111000000110101011110110100000010000001
50 8840088596980
00000010000001101010101001101010111000110010100110
50 280700827717974
01111001010010011000001011001100001101000110111110
#include<iostream>
#include<cstring>
using namespace std;
typedef long long LL;
#define rep(i,s,t) for(I i=s;i<=t;++i)
#define c(f) memset(f,-1,sizeof f)
#define R return
#define I int
LL f[55][2][2],K;I a[55],n;
LL C(I l,I r,I x,I y){
   if (l>r)R 1;LL&F=f[l][x][y];if(~F)R F;F=0;
   rep(i,0,1)rep(j,0,1)if(a[l]-(!i)&&a[r]-(!j)&&(l<r||i==j)&&(x||i<=j)&&(y||i<=(!j)))F+=C(l+1,r-1,x||(i<j),y||(i<!j));R F;
}
I main(){
  cin>>n>>K;c(a);c(f);
  if (C(1,n,a[1]=0,0)<++K){cout<<"-1";R 0;}
  rep(i,2,n){a[i]=0,c(f);LL d=C(1,n,0,0);K-=(a[i]=(d<K))*d;}
  rep(i,1,n)cout<<a[i];
}