시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 1 0 0 0.000%

문제

Let w be a positive integer and p be a string of length 22w+1. (w, p)− cell automaton is defined as follows:

  • The cells are arranged in an infinitely long 1-dimensional line.
  • Each cell can take two states: 0 and 1.
  • At time 0, Snuke chooses some (finite number of) cells and set their states to 1. He sets the states of other cells to 0.
  • Let f(t, x) be the state of the cell x at time t(> 0). f(t, x) is determined from f(t − 1, x − w), · · · , f(t − 1, x + w) according to the following rule:

\[f(t,x) = p[\sum_{i=-w}^{w}{2^{w+i}f(t-1,x+i)}]\]

Snuke likes a cell automaton if the number of 1 doesn’t change forever (no matter how he chooses the states at time 0). You are given an integer w and a string s. Compute the lexicographically minimal p such that s ≤ p and Snuke likes (w, p)− cell automaton.

입력

First line of the input contains one integer w (1 ≤ w ≤ 3). Next line contains string s (|s| = 22w+1, s consists of ‘0’ and ‘1’.

출력

Print the minimal possible p. If there are no such strings, print “no” instead.

예제 입력 1

1
00011000

예제 출력 1

00011101

예제 입력 2

1
11111111

예제 출력 2

no