#C3610. Cookie Pattern Assignment

    ID: 47057 Type: Default 1000ms 256MiB

Cookie Pattern Assignment

You are given a set of binary patterns and a number of cookies (friends). Your task is to assign a unique binary pattern to each cookie from the given list. A valid assignment exists if and only if \( N \leq P \), where \( N \) is the number of cookies and \( P \) is the number of available patterns.

If the assignment is possible, output the first \( N \) patterns in the given order, each on a new line. Otherwise, output the string "Impossible".

Note: The input will be provided via standard input and the output should be printed to standard output.

inputFormat

The first line contains two integers \( N \) and \( P \) separated by a space, representing the number of cookies and the number of available patterns respectively. The following \( P \) lines each contain a binary string representing a pattern.

outputFormat

If a valid assignment exists (i.e. \( N \leq P \)), output the first \( N \) patterns (each in a new line). Otherwise, output a single line with the string "Impossible".

## sample
3 4
0110
1001
0011
1100
0110

1001 0011

</p>