Woburn Challenge 2017-18 Round 3 - Junior Division

As part of your internship at a popular meme generation site, you've been tasked with implementing a new ASCII art feature!
You're given a grid of non-whitespace characters with
The user will first specify a non-empty string
Finally, the user will specify a non-empty string
Your task is to generate the resulting
Input Specification
The first line of input consists of two space-separated integers,
The next line consists of a single string,
The next line consists of a single string,
Output Specification
Output
Sample Input
17 28
........._.............__...
........|+\.........../++|..
........|__\______.../+++|..
......./==========\_/++++|..
....._/=============\++++|..
..._/================\_++|..
../===/#\==============\_|..
..|==\##/====/##\========\..
.|===========\##/=========\.
.|=================++++====|
|====####=========++++++===|
|===|####=========++++++===|
|===\###___/======++++++===|
|==================++++====|
.|========================|.
..\=======================|.
...\=====================/..
VERY_ART
WOW
Sample Output
........._.............__...
........|+VERY.ART..../++|..
........|__\______.../+++|..
......./==========\_/++++|..
....._/=============\++++|..
..._/================\_++|..
../===/#\==============\_|..
..|==\##/====/##\========\..
.|===========\##/=========\.
.|=================++++====|
|====####=========++++++===|
|===|####=========++++++===|
|===\###___/======++++++===|
|==================++++====|
.|========================|.
..\=========WOW===========|.
...\=====================/..
Sample Explanation
Much ASCII.
Comments