Problem: teams participate in a playoff tournament. The tournament consists of games. They are held as follows: in the first phase of the tournament, the teams are split into pairs: team plays against team , team plays against team , and so on (so, games are played in that phase). When a team loses a game, it is eliminated, and each game results in elimination of one team (there are no ties). After that, only teams remain. If only one team remains, it is declared the champion; otherwise, the second phase begins, where games are played: in the first one of them, the winner of the game " vs " plays against the winner of the game " vs ", then the winner of the game " vs " plays against the winner of the game " vs ", and so on. This process repeats until only one team remains.
The skill level of the -th team is , where is a permutation of integers , , ..., (a permutation is an array where each element from to occurs exactly once).
You are given a string which consists of characters. These characters denote the results of games in each phase of the tournament as follows:
- if is equal to 0, then during the -th phase (the phase with games), in each match, the team with the lower skill level wins;
- if is equal to 1, then during the -th phase (the phase with games), in each match, the team with the higher skill level wins.
Let's say that an integer is winning if it is possible to find a permutation such that the team with skill wins the tournament. Find all winning integers.
Input Format: The first line contains one integer ().
The second line contains the string of length consisting of the characters 0 and/or 1.
Output Format: Print all the winning integers in ascending order.