#include <iostream>
using namespace std;
int main()
{
    int n , m , x;
    cin >> x;
    n = (13 * x);
    m = (6 * x);

    for ( int i = 0 ; i < n; i ++ )
    {
        for ( int j = 0 ; j < m ; j ++ )
        {
            if ((3*x <= j && j < 4*x) || (8*x <= i && i < 9*x) || ((12*x <= i && i < 13*x) && (x <= j && j < 5*x)) || ((2*x <= j && j < 3*x) && i > x))
            {
                cout << "$$";
            }

            else 
            {
                cout << "  ";
            }
        }

        cout << '\n';
    }


    return 0;
}