P10436 [AOJ] Cellular Automaton
普及
题目描述

Let w be a positive integer and p be a character string with a length of 22w + 1. (w, p) -A cellular automaton is as follows.

  • An infinite number of cells that can take the state of 0 or 1 are lined up in one dimension.
  • At time 0, Sunuke can choose any finite number of squares and set the state to 1. The remaining cells are 0.
  • The state f (t, x) of cell x at time t (> 0) is determined by f (t − 1, x − w), ..., f (t − 1, x + w) as follows. Determined:
    \ begin {eqnarray} f (t, x) = p [\ sum ^ w_ {i = -w} 2 ^ {w + i} f (t − 1, x + i)] \; \; \; \; \; \; \; \; \; \; (1) \ end {eqnarray}

Sunuke likes cellular automata so that the number of 1s does not change from the initial state no matter how the initial state is selected at time 0. Given the integer w and the string s, find the smallest p that is greater than or equal to s in lexicographical order (w, p) -cell automaton is preferred by you.

Constraints

  • 1 ≤ w ≤ 3
  • | s | = 22w + 1
  • The only characters that appear in s are '0' and '1'

Input

w
s

Output

Output the minimum p that satisfies the condition. If there is no such thing, output "no".

Examples

Input

1
00011000

Output

00011101

Input

1
11111111

Output

no

输入格式

见题面

输出格式

见题面

样例输入
1 11111111
样例输出
no