`{"id":"c78e1553-c736-4b12-b097-acd9d4d14c11","name":"Phoenix And Distribution","description":"<a href=\"https://codeforces.com/problemset/problem/1348/C\" target=\"_blank\"><i class=\"fa fa-external-link\" aria-hidden=\"true\"> Link -> Phoenix and Distribution</i></a>","inputFormat":"check the link","outputFormat":"check the link","constraints":"check the link","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.*;\r\n\r\npublic class Main {\r\n public static void main(String[] args) {\r\n Scanner sc = new Scanner(System.in);\r\n\r\n //Code here\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"6\r\n4 2\r\nbaba\r\n5 2\r\nbaacb\r\n5 3\r\nbaacb\r\n5 3\r\naaaaa\r\n6 4\r\naaxxzz\r\n7 1\r\nphoenix\r\n","sampleOutput":"ab\r\nabbc\r\nb\r\naa\r\nx\r\nehinopx\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"a2073e25-96a1-4875-b400-f40bbe2edd95","name":"Text Processing For Experts","slug":"text-processing-for-experts-859","type":0},{"id":"4b72dd30-93a9-41af-aa1d-77208eed73e4","name":"Phoenix And Distribution","slug":"phoenix-and-distribution","type":1}],"next":{"id":"877f516e-5843-4f6e-a8ab-c134136813c6","name":"Make Palindrome","type":1,"slug":"make-palindrome"},"prev":{"id":"94272f11-e4a8-4ca1-bcc4-7ad899bfa272","name":"Remove Adjacent","type":1,"slug":"remove-adjacent"}}}`

# Phoenix And Distribution

<a href="https://codeforces.com/problemset/problem/1348/C" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Phoenix and Distribution</i></a>

`{"id":"c78e1553-c736-4b12-b097-acd9d4d14c11","name":"Phoenix And Distribution","description":"<a href=\"https://codeforces.com/problemset/problem/1348/C\" target=\"_blank\"><i class=\"fa fa-external-link\" aria-hidden=\"true\"> Link -> Phoenix and Distribution</i></a>","inputFormat":"check the link","outputFormat":"check the link","constraints":"check the link","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.*;\r\n\r\npublic class Main {\r\n public static void main(String[] args) {\r\n Scanner sc = new Scanner(System.in);\r\n\r\n //Code here\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"6\r\n4 2\r\nbaba\r\n5 2\r\nbaacb\r\n5 3\r\nbaacb\r\n5 3\r\naaaaa\r\n6 4\r\naaxxzz\r\n7 1\r\nphoenix\r\n","sampleOutput":"ab\r\nabbc\r\nb\r\naa\r\nx\r\nehinopx\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"a2073e25-96a1-4875-b400-f40bbe2edd95","name":"Text Processing For Experts","slug":"text-processing-for-experts-859","type":0},{"id":"4b72dd30-93a9-41af-aa1d-77208eed73e4","name":"Phoenix And Distribution","slug":"phoenix-and-distribution","type":1}],"next":{"id":"877f516e-5843-4f6e-a8ab-c134136813c6","name":"Make Palindrome","type":1,"slug":"make-palindrome"},"prev":{"id":"94272f11-e4a8-4ca1-bcc4-7ad899bfa272","name":"Remove Adjacent","type":1,"slug":"remove-adjacent"}}}`

Editor

# Phoenix And Distribution

easy

## Example

Sample Input

```.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}6 4 2 baba 5 2 baacb 5 3 baacb 5 3 aaaaa 6 4 aaxxzz 7 1 phoenix ```

### Sample Output

```.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}ab abbc b aa x ehinopx ```

Discussions

Show Discussion

Related Resources