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

## 문제

Mickey has a long strip of paper and he wants to fold it several times in order to make it as short as possible.

Strip is of size 1xN cm and it is divided into N equal squares. Each square is colored on both sides either in red or blue color, under the restriction that the two sides of the same square are colored in different colors.

Mickey is folding the strip in the following way: in every step he chooses some number K (positive integer smaller than the current length of the strip), and at the position of K cm from the left edge of the strip he lifts the left part of the strip and folds it firmly onto the right part of the strip. During the folding, two squares of the same color must not be pressed one onto the other.

Example of folding steps corresponding to the solution of the example:

Write a program that will determine some sequence of folding steps so that final folded strip is as short as possible.

## 입력

First line of input contains an integer N, 2 ≤ N ≤ 10,000, the length of the strip. Second line contains a sequence of N characters 'c' ('crveno' i.e. 'red') or 'p' ('plavo' or 'blue'). The ith character in the sequence denotes the color of the upper side of the ith square on the strip.

## 출력

First line of output should contain the length of strip at the end of the folding.

Second line should contain the number M, total number of folding steps, and third line should contain M numbers so that ith number denotes the number K at the ith folding step.

Note: solution needs not to be unique.

## 예제 입력 1

10
ccppccppcp


## 예제 출력 1

2
5
2 2 2 3 1
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.48649829626083374, "perplexity": 923.9514167403538}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-09/segments/1550247514804.76/warc/CC-MAIN-20190222074154-20190222100154-00032.warc.gz"}