#include <iostream>
using namespace std;
int main(){
// half pyramid using *
int n;
cin >>n;
for( int i = 0; i < n; i++ ) {
for( int j = 0; j <= i; j++ ){
cout << "* ";
}
cout<<"\n";
}
// half pyramid using numbers
for( int i = 0; i < n; i++ ) {
for( int j = 0; j <= i; j++ ){
cout <<i+1 <<"";
}
cout<<"\n";
}
// half pyramid using Alphabets
for( int i = 0; i < n; i++ ) {
for( int j = 0; j <= i; j++ ){
cout << (char)('g' + j) << " ";
}
cout<<"\n";
}
// Rectangle pattern
int p,s;
cin>>p>>s;
for( int i = 0; i <= p; i++ ) {
for( int j = 0; j < s; j++ ){
cout << "# ";
}
cout<<"\n";
}
// hollow rec
// for( int i = 0; i <= p; i++ ) {
// for( int j = 0; j < s; j++ ){
// if(i == 0 || i ==p - 1 || j == 0 || j == s - 1);
// cout << "* ";
// else;
// cout << " ";
// }
// cout<<"\n";
// }
// Floyd's triangle
int k;
cin >>k;
int increaser = 1;
for( int i = 0; i < k; i++ ) {
for( int j = 0; j <= i; j++ ){
cout << (increaser++) << " ";
}
cout<<"\n";
}
// butterfly
int r;
cin >>r;
for( int i = 0; i <= r; i++ ){
for( int j = 0; j <= i; j++ ){
cout << "* ";
}
int gaps = 2 * (r - i);
for( int j = 0; j < gaps; j++){
cout << " ";
}
for( int j = 0; j <= i; j++ ){
cout << "* ";
}
cout <<"\n";
}
for( int i = r - 1; i >= 0; i-- ){
for( int j = 0; j <= i; j++ ){
cout << "* ";
}
int gaps = 2 * (r - i);
for( int j = 0; j < gaps; j++){
cout << " ";
}
for( int j = 0; j <= i; j++ ){
cout << "* ";
}
cout <<"\n";
}
// pascals triangle
int h;
cin >>h;
for( int i = 0; i < h; i++){
int gaps = h - i;
for( int j = 0; j < gaps; j++){
cout<<" ";
}
int coefficient;
for( int j = 0; j <= i; j++){
if( j == 0 )
coefficient = 1;
else
coefficient = coefficient * (i - j + 1) / j;
cout << coefficient << " ";
}
cout <<"\n";
}
// pyramids
int a;
cin >> a;
for( int i = 0; i < a; i++ ) {
int gaps = a - i;
for( int j = 0; j < gaps; j++){
cout <<" ";
}
for( int j = 0; j < 2 * i - 1; j++){
cout <<"* ";
}
cout <<"\n";
}
// sir i dont lnow how to call the function but the simple calculator and other two problems are calling the functons so they are not understanding so i stoped upto here iam requesting to teach how to call a function in next class.
}