Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
main_program{
	int n,i=1,j,s;
	cin>>n;
	s=n*n;
	j=n;
	while(s>0){
		if (i%2!=0){
			bool found=false;
			while(true){
				int p=i;
				while(p>0&& found!=true){
					cout<<'o';
					p--;
					j--;
					s--;
					if (p==0){
						found=true;
					}
				}
				if (j==0){
					j=n;
					break;
				}
				cout<<'x';
				j--;
				s--;
				if (j==0){
                                        j=n;
                                        break;
				}
				cout<<'o';
				j--;
				s--;
			        if (j==0){
                                        j=n;
                                        break;
				}
			}
			i++;
		}
		cout<<endl;
		if( s==0) break;
		if (i%2==0){
			bool found=false;
                        while(true){
                                int p=i;
                                while(p>0&& found!=true){
                                        cout<<'x';
                                        p--;
                                        j--;
                                        s--;
                                        if (p==0){
                                                found=true;
                                        }
                                }
                                if (j==0){
                                        j=n;
                                        break;
                                }
                                cout<<'o';
                                j--;
                                s--;
                                if (j==0){
                                        j=n;
                                        break;
                                }
                                cout<<'x';
                                j--;
                                s--;
                                if (j==0){
                                        j=n;
                                        break;
                                }
                        }
                        i++;
		}
		cout<<endl;
	}
}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

Assigned grade: A