Start: Dec, 02, 2017 12:00:00
2017年秋季学期程序设计基础(C语言)第二次考试
End: Dec, 02, 2017 15:00:00
Time elapsed:
Time remaining:

LSB replacement 1468

Time Limit:  6 s      Memory Limit:   64 MB
Submission:0     AC:0     Score:0

Description

Information hiding in computer science is the principle of hiding of design decisions in a computer program that are most likely to change, thus protecting other parts of the program from change if the design decision is changed. The protection involves providing a stable interface which shields the remainder of the program from the implementation (the details that are most likely to change). Steganography is an application of information ahiding. The LSB(Least-significant-bit) is most widely used.LSB replacement embeds a message into the cover image by replacing the LSBs of the cover image with message bits to get the stego image.LSB replacement increases even pixel values either by one or leaves them unmodified,while odd values are left unchanged or decreased by one.eg.we want to embed the secret message ‘0101’ to the cover data ‘13 12 11 10’,we then get the stego data ’12 13 10 11’.First we embed the binary bit 0 to 13, since 13’s binary format is ‘1101’ ,so ,we replace the last bit 1 with 0.Now we get the stego data 1100 = 12. Now give you the secret message and the cover images, can your embedded the message into the cover image?

Input

the there are two integer n,m,(n,m < 513),then the cover image data,m line and each line n integers.the next line is the secret message.First you need to change the message to binary stream,the message use ASCII code.Then embed the binary stream into the cover images sequently.

Output

Output the stego image data.If cannot embed all of the message in the cover image,you should print: LSB embedding Error!

Samples

input
8 1 1 2 3 4 5 6 7 8 A
output
0 3 2 4 4 6 6 9