Introduction
As we know, TCS hosts a yearly coding contest named TCS codevita. The great programmers take part in this contest. This contest can help you get great job opportunities at TCS. Getting a good rank at TCS codevita will also boost your resume.
In this blog, we will be solving one of the questions of this contest.
Problem Statement
Three characters { #, *, . } represents a constellation of stars and galaxies in space. Each galaxy is demarcated by # characters. There can be one or many stars in a given galaxy. Stars can only be in the shape of vowels { A, E, I, O, U }. A collection of * in the shape of the vowels is a star. A star is contained in a 3x3 block. Stars cannot be overlapping. The dot(.) character denotes empty space.
Given 3xN matrix comprising of { #, *, . } character, find the galaxy and stars within them.
Note: Please pay attention to how vowel A is denoted in a 3x3 block in the examples section below.
Constraints
3 <= N <= 10^5
Input
Input consists of a single integer N denoting the number of columns.
Output
The output contains vowels (stars) in order of their occurrence within the given galaxy. The galaxy itself is represented by the # character.
Time Limit
1 sec
Example
Input
18
*.*#***#***#***.*.
*.*#*.*#.*.#******
***#***#***#****.*
Output
U#O#I#EA
Explanation
As it can be seen that the stars make the image of the alphabets U, O, I, E, and A respectively.





