#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000000

long long int pre[2001],suff[2001],sum[2001][2001],dp[2001][2001];
int  a[2001][2001];
vector<long long int>row[100001];

int main()
{
	ios::sync_with_stdio(false);
	int n,m;
	long long int i,j,ans=-2000000000000,cur;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(i=1;i<=n;i++)
	{
	//	sort(row[i].begin(),row[i].end());
	//	reverse(row[i].begin(),row[i].end());
		for(j=1;j<=m;j++)
		{
			sum[i][j]=sum[i][j-1]+a[i][j];
		}
	}
/*	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		cout<<sum[i][j]<<" ";
		cout<<endl;
	}
	cout<<endl;*/
	for(i=1;i<=m;i++)
	dp[1][i]=sum[1][i];
	for(i=1;i<=m;i++)
	{
		if(i==1)
		pre[i]=dp[1][i];
		else
		pre[i]=max(pre[i-1],dp[1][i]);
	}
	for(i=m;i>=1;i--)
	{
		if(i==m)
		suff[i]=dp[1][i];
		else
		suff[i]=max(suff[i+1],dp[1][i]);
	}
	/*cout<<"start"<<endl;
	for(i=1;i<=m;i++)
	cout<<pre[i]<<" ";
	cout<<endl;
	for(i=1;i<=m;i++)
	cout<<suff[i]<<" ";
	cout<<endl;
	cout<<"END"<<endl;*/
	for(i=2;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			if(i%2!=0) //prev is smaller
			{
				cur=sum[i][j];
				if(j==1)
				{
					dp[i][j]=-inf;
					continue;
				}
				dp[i][j]=pre[j-1]+cur;
			}
			else //prev is bigger
			{
				cur=sum[i][j];
				if(j==m)
				{
					dp[i][j]=-inf;
					continue;
				}
				dp[i][j]=suff[j+1]+cur;
			}
		}
		for(j=1;j<=m;j++)
		{
			if(j==1)
			pre[j]=dp[i][j];
			else
			pre[j]=max(pre[j-1],dp[i][j]);
		}
		for(j=m;j>=1;j--)
		{
			if(j==m)
			suff[j]=dp[i][j];
			else
			suff[j]=max(suff[j+1],dp[i][j]);
		}
	}
	/*for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		cout<<dp[i][j]<<" ";
		cout<<endl;
	}*/
	for(j=1;j<=m;j++)
	ans=max(ans,dp[n][j]);
	cout<<ans;
	return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000000

long long int a[2001][2001],pre[2001],suff[2001],sum[2001][2001],dp[2001][2001];
vector<long long int>row[100001];

int main()
{
	ios::sync_with_stdio(false);
	long long int i,j,n,m,ans=-2000000000000,cur;
	cin>>n>>m;
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			cin>>a[i][j];
			row[i].push_back(a[i][j]);
		}
	}
	for(i=1;i<=n;i++)
	{
	//	sort(row[i].begin(),row[i].end());
	//	reverse(row[i].begin(),row[i].end());
		for(j=1;j<=m;j++)
		{
			sum[i][j]=sum[i][j-1]+row[i][j-1];
		}
	}
/*	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		cout<<sum[i][j]<<" ";
		cout<<endl;
	}
	cout<<endl;*/
	for(i=1;i<=m;i++)
	dp[1][i]=sum[1][i];
	for(i=1;i<=m;i++)
	{
		if(i==1)
		pre[i]=dp[1][i];
		else
		pre[i]=max(pre[i-1],dp[1][i]);
	}
	for(i=m;i>=1;i--)
	{
		if(i==m)
		suff[i]=dp[1][i];
		else
		suff[i]=max(suff[i+1],dp[1][i]);
	}
	/*cout<<"start"<<endl;
	for(i=1;i<=m;i++)
	cout<<pre[i]<<" ";
	cout<<endl;
	for(i=1;i<=m;i++)
	cout<<suff[i]<<" ";
	cout<<endl;
	cout<<"END"<<endl;*/
	for(i=2;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			if(i%2!=0) //prev is smaller
			{
				cur=sum[i][j];
				if(j==1)
				{
					dp[i][j]=-inf;
					continue;
				}
				dp[i][j]=pre[j-1]+cur;
			}
			else //prev is bigger
			{
				cur=sum[i][j];
				if(j==m)
				{
					dp[i][j]=-inf;
					continue;
				}
				dp[i][j]=suff[j+1]+cur;
			}
		}
		for(j=1;j<=m;j++)
		{
			if(j==1)
			pre[j]=dp[i][j];
			else
			pre[j]=max(pre[j-1],dp[i][j]);
		}
		for(j=m;j>=1;j--)
		{
			if(j==m)
			suff[j]=dp[i][j];
			else
			suff[j]=max(suff[j+1],dp[i][j]);
		}
	}
	/*for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		cout<<dp[i][j]<<" ";
		cout<<endl;
	}*/
	for(j=1;j<=m;j++)
	ans=max(ans,dp[n][j]);
	cout<<ans;
	return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000000

long long int a[1001][1001],pre[1001],suff[1001],sum[1001][1001],dp[1001][1001];
vector<long long int>row[100001];

int main()
{
	long long int i,j,n,m,ans=-2000000000000,cur;
	cin>>n>>m;
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			cin>>a[i][j];
			row[i].push_back(a[i][j]);
		}
	}
	for(i=1;i<=n;i++)
	{
	//	sort(row[i].begin(),row[i].end());
	//	reverse(row[i].begin(),row[i].end());
		for(j=1;j<=m;j++)
		{
			sum[i][j]=sum[i][j-1]+row[i][j-1];
		}
	}
/*	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		cout<<sum[i][j]<<" ";
		cout<<endl;
	}
	cout<<endl;*/
	for(i=1;i<=m;i++)
	dp[1][i]=sum[1][i];
	for(i=1;i<=m;i++)
	{
		if(i==1)
		pre[i]=dp[1][i];
		else
		pre[i]=max(pre[i-1],dp[1][i]);
	}
	for(i=m;i>=1;i--)
	{
		if(i==m)
		suff[i]=dp[1][i];
		else
		suff[i]=max(suff[i+1],dp[1][i]);
	}
	/*cout<<"start"<<endl;
	for(i=1;i<=m;i++)
	cout<<pre[i]<<" ";
	cout<<endl;
	for(i=1;i<=m;i++)
	cout<<suff[i]<<" ";
	cout<<endl;
	cout<<"END"<<endl;*/
	for(i=2;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			if(i%2!=0) //prev is smaller
			{
				cur=sum[i][j];
				if(j==1)
				{
					dp[i][j]=-inf;
					continue;
				}
				dp[i][j]=pre[j-1]+cur;
			}
			else //prev is bigger
			{
				cur=sum[i][j];
				if(j==m)
				{
					dp[i][j]=-inf;
					continue;
				}
				dp[i][j]=suff[j+1]+cur;
			}
		}
		for(j=1;j<=m;j++)
		{
			if(j==1)
			pre[j]=dp[i][j];
			else
			pre[j]=max(pre[j-1],dp[i][j]);
		}
		for(j=m;j>=1;j--)
		{
			if(j==m)
			suff[j]=dp[i][j];
			else
			suff[j]=max(suff[j+1],dp[i][j]);
		}
	}
	/*for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		cout<<dp[i][j]<<" ";
		cout<<endl;
	}*/
	for(j=1;j<=m;j++)
	ans=max(ans,dp[n][j]);
	cout<<ans;
	return 0;
}


import java.util.Scanner;

public class CodeForces1 {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int m = reader.nextInt();
		int n = reader.nextInt();

		double res = m;
		for (int k=1; k<=m-1; k++) {
			res -= Math.pow((double) k /m, n);
		}

		System.out.println(res);

		reader.close();
	}
}


import java.util.*;
public class  c {
public static void main(String [] args){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int start=n/2;
int end=n/2;
char array[][]=new char[n][n];
for(int i=0;i<=n/2;i++){
for(int j=0;j<n;j++){
if(j>=start && j<=end)
array[i][j]=array[n-1-i][j]='D';
else
array[i][j]=array[n-1-i][j]='*';
}
start--;
end++;
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.print(array[i][j]);
}
System.out.println();
}
}
}


import java.util.*;

public class Main
{
    public static void main(String[] args)
    {

        int n =new Scanner(System.in).nextInt();

        int left=n / 2,right=n / 2,half = n / 2;
        String up[] = new String[half];
        String center="";

        for (int i = 0;i < half;i++)
        {
            up[i] = "";
            for (int j =0;j < n;j++)
                if (j >= left && j <= right)
                    up[i] += "D";
                else
                    up[i] += "*";

            left--;
            right++;

        }

        for (int i =0;i < n;i++)
            center += "D";

        for (int i=0;i < half;i++)
            System.out.println(up[i]);

        System.out.println(center);

        for (int i = half - 1;i > -1;i--)
            System.out.println(up[i]);

    }//main

}


import java.util.*;
import java.io.*;
import java.math.*;

public class test {

static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
	return Long.parseLong(next());
    }

}

 static class Task {

	public void solve(int testNumber, InputReader in, PrintWriter out) {
  		while(testNumber-->0) {

			int n = in.nextInt();
			char arr[][] = new char[105][105];
			for(int i=1;i<=n;++i)
				for(int j=1;j<=n;++j)
					arr[i][j]='*';

			int mid = (n+1)/2;
			int k=-1;
			for(int i=1;i<=n;++i) {

				if(i<=mid)
					k=k+1;
				else
					k=k-1;
				for(int j=mid-k;j<=mid+k;++j)
					arr[i][j]='D';

			}

			for(int i=1;i<=n;++i) {
				for(int j=1;j<=n;++j)
					out.print(arr[i][j]);
				out.println();
			}

    		}
	}

}

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        int test  = 1;
        solver.solve(test, in, out);
        out.close();
    }

}


import java.lang.*;
import java.io.*;
import java.util.*;

public class Mine {

	public static void main(String[] args) throws java.lang.Exception {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}
}

class TaskA {

	public void solve(InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int i, j, k;
		int n_ = n / 2;
		int b = n_, e = n_;;

		for (i=0; i<=n_; ++i, --b, ++e) {
			for (j=0; j<b; ++j)
				out.print('*');
			for (; j<=e; ++j)
				out.print('D');
			for (; j<n; ++j)
				out.print('*');
			out.println();
		}

		b = 1;
		e = n-2;
		for (; i<n; ++i,++b,--e) {
			for (j=0; j<b; ++j)
				out.print('*');
			for (; j<=e; ++j)
				out.print('D');
			for (; j<n; ++j)
				out.print('*');
			out.println();
		}
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}

	public String next() {
		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}
}


import java.io.*;
import java.util.*;

public class Main {

    static MyScanner in;
    static PrintWriter out;
    //static Timer t = new Timer();

    public static void main(String[] args) throws IOException {
        in = new MyScanner();
        out = new PrintWriter(System.out);

        int n = in.nextInt();

        int star = n / 2;
        int d = 1;

        while(star != 0) {
            for(int i = 0; i < star; i++)
                out.print("*");
            for(int i = 0; i < d; i++)
                out.print("D");
            for(int i = 0; i < star; i++)
                out.print("*");

            out.println();
            star--;
            d += 2;
        }

        for(int i = 0; i < n; i++)
            out.print("D");
        out.println();

        d = n - 2;
        star = 1;
        while(d != -1) {
            for(int i = 0; i < star; i++)
                out.print("*");
            for(int i = 0; i < d; i++)
                out.print("D");
            for(int i = 0; i < star; i++)
                out.print("*");

            out.println();
            star++;
            d -= 2;
        }

        out.flush();
    }
}

//<editor-fold defaultstate="collapsed" desc="MyScanner">
class MyScanner {

    private final BufferedReader br;
    private StringTokenizer st;

    public MyScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public MyScanner(String path) throws FileNotFoundException {
        br = new BufferedReader(new FileReader(new File(path)));
    }

    String next() throws IOException {
        while (st == null || !st.hasMoreElements())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    boolean hasNext() {
        if (st != null && st.hasMoreElements())
            return true;

        try {
            while (st == null || !st.hasMoreElements())
                st = new StringTokenizer(br.readLine());
        }
        catch (Exception e) {
            return false;
        }

        return true;
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    String[] nextStrings(int n) throws IOException {
        String[] arr = new String[n];
        for (int i = 0; i < n; i++)
            arr[i] = next();
        return arr;
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    int[] nextInts(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextInt();
        return arr;
    }

    void nextInts(int[] arr, int from, int to) throws IOException {
        for (int i = from; i < to; i++)
            arr[i] = nextInt();
    }

    int[][] next2Ints(int n, int m) throws IOException {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                arr[i][j] = nextInt();
        return arr;
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    long[] nextLongs(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextLong();
        return arr;
    }

    void nextLongs(long[] arr, int from, int to) throws IOException {
        for (int i = from; i < to; i++)
            arr[i] = nextLong();
    }

    long[][] next2Longs(int n, int m) throws IOException {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                arr[i][j] = nextLong();
        return arr;
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next().replace(',', '.'));
    }

    double[] nextDoubles(int size) throws IOException {
        double[] arr = new double[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextDouble();
        return arr;
    }

    boolean nextBool() throws IOException {
        String s = next();
        if (s.equalsIgnoreCase("true") || s.equals("1"))
            return true;

        if (s.equalsIgnoreCase("false") || s.equals("0"))
            return false;

        throw new IOException("Boolean expected, String found!");
    }
}
//</editor-fold>


import java.io.*;
import java.util.*;

public class Main {

    static MyScanner in;
    static PrintWriter out;
    //static Timer t = new Timer();

    public static void main(String[] args) throws IOException {
        in = new MyScanner();
        out = new PrintWriter(System.out);

        int n = in.nextInt();

        char[] arr = new char[n];
        Arrays.fill(arr, '*');

        int lo = n / 2;
        int hi = lo;

        while(lo >= 0) {
            arr[lo] = arr[hi] = 'D';
            out.println(new String(arr));

            lo--;
            hi++;
        }

        lo++;
        hi--;
        while(lo != hi) {
            arr[lo] = arr[hi] = '*';
            out.println(new String(arr));

            lo++;
            hi--;
        }

        out.flush();
    }
}

//<editor-fold defaultstate="collapsed" desc="MyScanner">
class MyScanner {

    private final BufferedReader br;
    private StringTokenizer st;

    public MyScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public MyScanner(String path) throws FileNotFoundException {
        br = new BufferedReader(new FileReader(new File(path)));
    }

    String next() throws IOException {
        while (st == null || !st.hasMoreElements())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    boolean hasNext() {
        if (st != null && st.hasMoreElements())
            return true;

        try {
            while (st == null || !st.hasMoreElements())
                st = new StringTokenizer(br.readLine());
        }
        catch (Exception e) {
            return false;
        }

        return true;
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    String[] nextStrings(int n) throws IOException {
        String[] arr = new String[n];
        for (int i = 0; i < n; i++)
            arr[i] = next();
        return arr;
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    int[] nextInts(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextInt();
        return arr;
    }

    void nextInts(int[] arr, int from, int to) throws IOException {
        for (int i = from; i < to; i++)
            arr[i] = nextInt();
    }

    int[][] next2Ints(int n, int m) throws IOException {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                arr[i][j] = nextInt();
        return arr;
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    long[] nextLongs(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextLong();
        return arr;
    }

    void nextLongs(long[] arr, int from, int to) throws IOException {
        for (int i = from; i < to; i++)
            arr[i] = nextLong();
    }

    long[][] next2Longs(int n, int m) throws IOException {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                arr[i][j] = nextLong();
        return arr;
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next().replace(',', '.'));
    }

    double[] nextDoubles(int size) throws IOException {
        double[] arr = new double[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextDouble();
        return arr;
    }

    boolean nextBool() throws IOException {
        String s = next();
        if (s.equalsIgnoreCase("true") || s.equals("1"))
            return true;

        if (s.equalsIgnoreCase("false") || s.equals("0"))
            return false;

        throw new IOException("Boolean expected, String found!");
    }
}
//</editor-fold>


import java.util.Scanner;

public class Main {//CF259A
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		PrintFirstHalf(n);
		PrintMiddle(n);
		PrintSecondHalf(n);
	}
	private static void PrintFirstHalf(int n){
		int a = n/2;
		int b = n- 2*a;

		while(b!=n){

			for(int i=0;i<a;i++){
				System.out.print("*");
			}
			for(int i =0;i<b;i++){
				System.out.print("D");
			}
			for(int i =0;i<a;i++){
				System.out.print("*");
			}
			System.out.println();
			a = a-1;
			b = b+2;
		}
	}
	private static void PrintMiddle(int n){
		for(int i=0;i<n;i++){
			System.out.print("D");
			}
		System.out.println();
	}
	private static void PrintSecondHalf(int n){
		int a = 1;
		int b = n- 2;

		while(b>0){

			for(int i=0;i<a;i++){
				System.out.print("*");
			}
			for(int i =0;i<b;i++){
				System.out.print("D");
			}
			for(int i =0;i<a;i++){
				System.out.print("*");
			}
			System.out.println();
			a = a+1;
			b = b-2;
		}
	}
}


import java.util.Scanner;

public class Solution
{
    public static void main(String arg[])
    {
         Scanner sc=new Scanner(System.in);
         int n,totalSpaces=0,i,spaces=1,k=1;
         n=sc.nextInt();
         totalSpaces=(int)(n/2);
         for(i=1;i<=n;i++)
         {
             spaces=Math.abs((totalSpaces+1)-i);
             if(spaces!=0)
             {
                 printStar(spaces);
             }
             k=n-(spaces*2);
             for(int j=1;j<=k;j++)
             {
                 System.out.print("D");
             }
             if(spaces!=0)
             {
                 printStar(spaces);
             }

             k=k+2;
             System.out.println();
         }

    }

    public static  void printStar(int space)
    {
        for(int i=1;i<=space;i++)
        {
            System.out.print("*");
        }
    }

}


import java.io.PrintWriter;
import java.util.*;

public class Solution {
    public static void main(String[] args) { new Solution().run(); }

    private void run() {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int mid, dCnt, sCnt, k;
        mid = n/2 + 1;

        for (int i = 1; i <= n; i++) {
            if (i <= mid)
                k = i;
            else
                k = n - i + 1;

            dCnt = 2*k - 1;
            sCnt = (n - dCnt) / 2;

            for (int j = 0; j < sCnt; j++)
                out.print("*");

            for (int j = 0; j < dCnt; j++)
                out.print("D");

            for (int j = 0; j < sCnt; j++)
                out.print("*");

            out.println();
        }

        in.close();
        out.close();
    }
}


import java.util.Scanner;

public class q1
{

	public static void main(String args[])
	{
		int n;
		Scanner s=new Scanner(System.in);
		n=s.nextInt();
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(i<=n/2)
				{
				if(Math.abs(j-n/2)<=i)
					System.out.print("D");
				else
					System.out.print("*");
				}
				else
				{
					if(Math.abs(j-n/2)<=n-i-1)
						System.out.print("D");
					else
						System.out.print("*");
				}

			}
			System.out.println();
		}

	}
}


import java.util.Scanner;

public class Main
{
    public static void main(String args[])
    {
        Scanner s=new Scanner(System.in);
        double m=s.nextInt();
        double n=s.nextInt();
        double ans=0;
        for(double i=m;i>=1;i--)
        {
            ans+=i*(Math.pow(i, n)-Math.pow(i-1, n))/Math.pow(m, n);
        }
        System.out.println(ans);
        s.close();

    }
}


package cd;

import java.util.Scanner;

public class q1
{

	public static void main(String args[])
	{
		int n;
		Scanner s=new Scanner(System.in);
		n=s.nextInt();
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(i<=n/2)
				{
				if(Math.abs(j-n/2)<=i)
					System.out.print("D");
				else
					System.out.print("*");
				}
				else
				{
					if(Math.abs(j-n/2)<=n-i-1)
						System.out.print("D");
					else
						System.out.print("*");
				}

			}
			System.out.println();
		}

	}
}


import java.util.Scanner;

/**
 *
 * @author Sami
 */
public class Cristal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        //int i=0;
        //int j=0;
        do {
            n = sc.nextInt();
        } while (n>101||n<3||n%2==0);
        int k=0;

        for(int i=1;i<=n;i++){

            k=((n+1)/2)-i;
            //System.out.println(k);
            if(k>=0){
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            }else{
                k=k*-1;
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            } System.out.println();
        }

    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cristal;

import java.util.Scanner;

/**
 *
 * @author Sami
 */
public class Cristal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        //int i=0;
        //int j=0;
        do {
            n = sc.nextInt();
        } while (n>101||n<3||n%2==0);
        int k=0;

        for(int i=1;i<=n;i++){
            System.out.println();
            k=((n+1)/2)-i;
            //System.out.println(k);
            if(k>=0){
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            }else{
                k=k*-1;
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            }
        }

    }
}


import java.util.Scanner;

/**
 *
 * @author Sami
 */
public class Cristal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        //int i=0;
        //int j=0;
        do {
            n = sc.nextInt();
        } while (n>101||n<3||n%2==0);
        int k=0;

        for(int i=1;i<=n;i++){
            System.out.println();
            k=((n+1)/2)-i;
            //System.out.println(k);
            if(k>=0){
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            }else{
                k=k*-1;
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            }
        }

    }
}


public class Cristal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        //int i=0;
        //int j=0;
        do {
            n = sc.nextInt();
        } while (n>101||n<3||n%2==0);
        int k=0;

        for(int i=1;i<=n;i++){
            System.out.println();
            k=((n+1)/2)-i;
            //System.out.println(k);
            if(k>=0){
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            }else{
                k=k*-1;
                for(int j=1;j<=n;j++){
                    if(j<=k||j>n-k){
                    System.out.print('*');
                }else{
                        System.out.print('D');
                    }
                }
            }
        }

    }
}


import java.util.*;
public class Invader {
public static void main(String [] args){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int start=n/2;
int end=n/2;
char array[][]=new char[n][n];
for(int i=0;i<n/2;i++){
for(int j=0;j<n;j++){
if(j>=start && j<=end)
array[i][j]='D';
else
array[i][j]='*';
}
start--;
end++;
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.print(array[i][j]);
}
System.out.println();
}
}
}


import java.util.*;
public class Invader {
public static void main(String [] args){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int start=n/2;
int end=n/2;
char array[]=new char[n][n];
for(int i=0;i<n/2;i++){
for(int j=0;j<n;j++){
if(j>=start && j<=end)
array[i][j]='D';
else
array[i][j]='*';
}
start--;
end++;
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.print(array[i][j]);
}
System.out.println();
}
}
}


import java.util.*;
public class Invader {
public static void main(String [] args){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int start=n/2;
int end=n/2;
char array[][]=new char[n][n];
for(int i=0;i<=n/2;i++){
for(int j=0;j<n;j++){
if(j>=start && j<=end)
array[i][j]=array[n-1-i][j]='D';
else
array[i][j]=array[n-1-i][j]='*';
}
start--;
end++;
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.print(array[i][j]);
}
System.out.println();
}
}
}


import java.util.*;
public class Invader {
public static void main(String [] args){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int start=n/2;
int end=n/2;
char array[][]=new char[n][n];
for(int i=0;i<n/2;i++){
for(int j=0;j<n;j++){
if(j>=start && j<=end)
array[i][j]=array[n-1-i][j]='D';
else
array[i][j]=array[n-1-i][j]='*';
}
start--;
end++;
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.print(array[i][j]);
}
System.out.println();
}
}
}


import java.io.*;
public class CF0454A
{
 public static void main(String[] helloWorld) throws IOException
 {
  BufferedReader sIn = new BufferedReader(new InputStreamReader(System.in));
  StringBuilder sB = new StringBuilder();
  int n = Integer.parseInt(sIn.readLine()) / 2;
  for (int i = -n; i <= n; i ++)
  {
   int ai = Math.abs(i);
   for (int j = -n; j <=n; j ++)
    sB.append((Math.abs(j) + ai <= n) ? "D" : "*");
   sB.append("\n");
  }
  System.out.print(sB);
 }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class TestClass{

    public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str2 = br.readLine();
        int len = Integer.parseInt(str2);
        ArrayList<String> arr = new ArrayList<String>();
        for(int i=1;i<=len;i+=2){
            String str="";
            int nstar = len-i;
            while(nstar>0){
                str+="*";
                nstar-=2;
            }
            int dup = i;
            while(dup>0){
                dup--;
                str+="D";
            }
            nstar = len-i;
            while(nstar>0){
                str+="*";
                nstar-=2;
            }
            arr.add(str.trim());
            //System.out.println();
        }

        for(String str:arr){
            System.out.println(str);
        }
        for(int i=arr.size()-2;i>=0;i--){
            System.out.println(arr.get(i));
        }

    }
}


import java.util.Scanner;
public class Main {
	private static void imprimirRenglon(int N,int cantD){
		int cantAsteriscos = (N-cantD)/2;
		for (int j = 1; j <= cantAsteriscos; j++ ){
			System.out.print('*');
		}
		for (int j = 1; j <= cantD; j++ ){
			System.out.print('D');
		}
		for (int j = 1; j <= cantAsteriscos; j++ ){
			System.out.print('*');
		}
		System.out.println();
	}
	public static void main(String[] args) {
		int N = (new Scanner (System.in)).nextInt();
		//System.out.println(N);
		for (int fila = 1 ; fila <= (N>>1); fila++){
			int cantD = (fila<<1)-1;
			imprimirRenglon(N,cantD);
		}
		for (int fila = (N>>1)+1 ; fila > 0; fila--){
			int cantD = (fila<<1)-1;
			imprimirRenglon(N,cantD);
		}
	}

}


package seis;

import java.util.Scanner;

/*
 * http://codeforces.com/problemset/problem/454/A
 * TAG: implementation
 */
public class Main {
	private static void imprimirRenglon(int N,int cantD){
		int cantAsteriscos = (N-cantD)/2;
		for (int j = 1; j <= cantAsteriscos; j++ ){
			System.out.print('*');
		}
		for (int j = 1; j <= cantD; j++ ){
			System.out.print('D');
		}
		for (int j = 1; j <= cantAsteriscos; j++ ){
			System.out.print('*');
		}
		System.out.println();
	}
	public static void main(String[] args) {
		int N = (new Scanner (System.in)).nextInt();
		//System.out.println(N);
		for (int fila = 1 ; fila <= (N>>1); fila++){
			int cantD = (fila<<1)-1;
			imprimirRenglon(N,cantD);
		}
		for (int fila = (N>>1)+1 ; fila > 0; fila--){
			int cantD = (fila<<1)-1;
			imprimirRenglon(N,cantD);
		}
	}

}


import java.util.Scanner;

/**
 * Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size
 * n (n is odd; n > 1) is an n × n matrix with a diamond inscribed into it.
 *
 * You are given an odd integer n. You need to draw a crystal of size n. The
 * diamond cells of the matrix should be represented by character "D". All other
 * cells of the matrix should be represented by character "*". Look at the
 * examples to understand what you need to draw.
 *
 * Input
 * The only line contains an integer n (3 ≤ n ≤ 101; n is odd).
 *
 * Output
 * Output a crystal of size n.
 *
 * Sample test(s)
 * input
 * 3
 * output
 * D* DDD D*
 * input
 * 5
 * output
 * D** DDD* DDDDD DDD*
 * D**
 * input
 * 7
 * output
 * D*** DDD** DDDDD* DDDDDDD DDDDD* DDD** D***
 *
 * @Title: A454LittlePonyandCrystalMine.java
 * @author lxh
 * @date Sep 20, 2015 1:35:45 PM
 *
 */

public class Main {
    public static void main(String []args){
        Scanner cin=new Scanner(System.in);
        int n=cin.nextInt();
        for(int i=1;i<=(n+1)/2;i++){
            for(int j=0;j<(n+1-2*i)/2;j++)System.out.print("*");
            for(int j=0;j<2*i-1;j++)System.out.print("D");
            for(int j=0;j<(n+1-2*i)/2;j++)System.out.print("*");
            System.out.println();
        }
        for(int i=(n+1)/2+1;i<=n;i++){
            int idx=i-(n+1)/2;
            for(int j=0;j<idx;j++)System.out.print("*");
            for(int j=0;j<n-2*idx;j++)System.out.print("D");
            for(int j=0;j<idx;j++)System.out.print("*");
            System.out.println();
        }
    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

/**
 *
 * @author Anextro
 */
public class Main {

    public static void main(String[] args) throws IOException {
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       BufferedWriter bw = new BufferedWriter(new PrintWriter(System.out));

       int n = Integer.parseInt(br.readLine());

       String[][] D = new String[n][n];

       int stop = (n+1)/2;

       for(int i=0;i<stop;i++){
           int cnt = 2*(i+1)-1;//number of D,s
           int bcnt = (n-cnt)/2;

           for(int j=0;j<bcnt;j++){
               if(D[i][j]==null)    D[i][j]="";
               D[i][j]+="*";
           }
           for(int j=bcnt;j<(bcnt+cnt);j++){
               if(D[i][j]==null)    D[i][j]="";
               D[i][j]+="D";
           }
           for(int j=(cnt+bcnt);j<n;j++){
               if(D[i][j]==null)    D[i][j]="";
               D[i][j]+="*";
           }

       }

       for(int k = stop;k<n;k++){
           int val = 2*(stop-1);

           int small = val-k;
           String out = "";

           for(int j=0;j<n;j++){
               if(D[k][j]==null)    D[k][j]="";
               D[k][j]=D[small][j];

           }

       }

       for(int i=0;i<n;i++){
           for(int j=0;j<n;j++){
               System.out.print(D[i][j]);
           }
           System.out.println();
       }

    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main {

    private static double getw(Node f, Node s) {
        double ans = 0.0;
        double sqrt1 = Math.pow((f.a - s.a),2);
        double sqrt2 = Math.pow((f.b - s.b),2);
       // System.out.println(sqrt1+" "+sqrt2);
        ans = Math.sqrt((sqrt1 + sqrt2));
        return ans;
    }

    private static boolean sameset(int a, int b, int[] uf) {

        return find(a,uf) == find(b,uf);
    }

    private static void union(int a, int b, int[] uf) {
        uf[find(a,uf)] = find(b,uf);
    }

    private static int find(int a, int[] uf) {
        if(a == uf[a])  return a;
        int root = find(uf[a],uf);
        uf[a] = root;
        return root;
    }

    private static void BFS(int i, int[][] G, int[][] path) {
       // System.out.println("source vertex "+i);
        int[] v = new int[G.length]; // current maximum dist in u---v path
        ArrayDeque<Integer> A = new ArrayDeque();
        A.add(i);
        while(A.isEmpty() == false){
            int u = A.pop();
            //System.out.println("for node "+u);
            for(int a=0;a<v.length;a++){
                if(G[u][a] > 0 && v[a]==0 && a!=i){//edge in MST, later make faster
                    //System.out.println(a+" is and edge from "+u);
                    if(G[u][a] > v[u]){
                        //System.out.println(" and it incrases the sub path max ");
                        v[a] = G[u][a];
                    }
                    else    v[a] = v[u];
                    path[i][a] = v[a];
                    path[a][i] = v[a];
                   // System.out.println("finally path from "+i+" to "+a+" is "+path[i][a]);

                    A.add(a);
                }
            }
        }
    }

    static class Node{
        double a;
        double b;
        public Node(double x, double y){
            this.a = x;
            this.b = y;
        }
    }

    static class Edge{

        int x;
        int y;//ids of nodes
        int w;
        public Edge( int x1, int y1, int w){

            this.x = x1;
            this.y = y1;
            this.w = w;
        }
    }

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new PrintWriter(System.out));

        int n = Integer.parseInt(br.readLine());

        char[][] D = new char[n][n];

        for(int i=0;i<n;i++){
            Arrays.fill(D[i],'*');
        }

//        for(int i=0;i<n;i++){
//            for(int j=0;j<n;j++){
//                System.out.print(D[i][j]);
//            }
//            System.out.println();
//        }

        int st=0;int ed=n-1;
        int x = (n+1)>>1;
        x-=1;
        for(int i=x;i>=0;i--){
            for(int j=st;j<=ed;j++){
                D[i][j] = 'D';
            }
            st+=1;ed-=1;
            if(st>ed)   break;
        }
        for(int i=x+1;i<n;i++){
            D[i] = D[n-i-1];
        }

        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                System.out.print(D[i][j]);
            }
            System.out.println();
        }
        bw.close();
    }

}


import java.io.*;
import java.util.*;

public class a1 {
	public static void main(String[] args) throws FileNotFoundException {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		for (int i = 0; i <= n / 2; i++) {
			for (int j = 0; j < n / 2 - i; j++) {
				out.print('*');
			}
			for (int j = 0; j < 2 * i + 1; j++) {
				out.print('D');
			}
			for (int j = 0; j < n / 2 - i; j++) {
				out.print('*');
			}
			out.println();
		}
		for (int i = n / 2 - 1; i >= 0; i--) {
			for (int j = 0; j < n / 2 - i; j++) {
				out.print('*');
			}
			for (int j = 0; j < 2 * i + 1; j++) {
				out.print('D');
			}
			for (int j = 0; j < n / 2 - i; j++) {
				out.print('*');
			}
			out.println();
		}
		out.close();
	}
}


import java.util.Scanner;

/**
 *
 * @author ZEZOmaster
 */
public class LittlePonyandCrystalMine {

    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        //the Top
        int counter = 1;
        for (int i = n / 2 + 1; i > 0; i--) {
            for (int j = 1; j < i; j++) {
                System.out.print("*");
            }
            for (int k = 0; k < counter; k++) {
                if (counter < n) {
                    System.out.print("D");
                } else {
                    break;
                }
            }
            for (int l = 1; l < i; l++) {
                System.out.print("*");
            }
            if (counter < n) {
                System.out.println("");
                counter += 2;
            }

        }
        //the Middle
        for (int h = 0; h < n; h++) {
            System.out.print("D");
        }
        System.out.println("");

        //the Bot
        counter = 1;
        for (int i = n / 2 + 1; i > 0; i--) {
            for (int j = i; j > 1; j--) {
                System.out.print("*");
            }
            for (int k = 0; k < counter; k++) {
                if (counter < n) {
                    System.out.print("D");
                } else {
                    break;
                }
            }
            for (int l = i; l > 1; l--) {
                System.out.print("*");
            }
            if (counter < n) {
                System.out.println("");
                counter += 2;
            }
        }
    }
}


import java.util.Scanner;

/**
 *
 * @author ZEZOmaster
 */
public class LittlePonyandCrystalMine {

    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        //the Top
        int counter = 1;
        for (int i = n / 2 + 1; i > 0; i--) {
            for (int j = 1; j < i; j++) {
                System.out.print("*");
            }
            for (int k = 0; k < counter; k++) {
                if (counter < n) {
                    System.out.print("D");
                } else {
                    break;
                }
            }
            for (int l = 1; l < i; l++) {
                System.out.print("*");
            }
            if (counter < n) {
                System.out.println("");
                counter += 2;
            }

        }
        //the Middle
        for (int h = 0; h < n; h++) {
            System.out.print("D");
        }
        System.out.println("");

        //the Bot
        counter-= 2;
        for (int i = 1 ; i  <n / 2 + 1; i++) {
            for (int j = i; j > 0; j--) {
                System.out.print("*");
            }
            for (int k = 0; k < counter; k++) {
                if (counter < n) {
                    System.out.print("D");
                } else {
                    break;
                }
            }
            for (int l = i; l > 0; l--) {
                System.out.print("*");
            }
            if (counter < n) {
                System.out.println("");
                counter -= 2;
            }
        }
    }
}


import java.util.Scanner;

public class tr {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	int k=1;
	int g=0;
	for(int i=1;i<=n;i++)
	{
	int h=(n-k)/2;
	for(int j=0;j<h;j++)
	{
		System.out.print('*');
	}
	for(int y=0;y<k;y++)
	{
		System.out.print('D');
	}
	for(int j=0;j<h;j++)
	{
		System.out.print('*');
	}
	System.out.println();
	if(k<n && g==0)
	{
		k=k+2;
	}
	else
	{
		k=k-2;
		g=1;
	}

	}

	}
}


import java.util.Scanner;

/**
 *
 * @author Annie
 */
public class Crystal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        char a[][] = new char[n][n];

        for(int i =0;i<n;i++){
             for(int j =0;j<n;j++){
            a[i][j]='D';

        }
        }
        int x = n/2;

        for(int i=0;i<x;i++){
        for(int j=0;j<x-i;j++){
        a[i][j]='*';
          a[i][n-1-j]='*';
        }

        }

        int k=0;
        for(int i=n-1;i>=x+1;i--){
        for(int j=0;j<x-k;j++){
        a[i][j]='*';
          a[i][n-1-j]='*';
        }
       k++;
        }

        for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
       System.out.print(a[i][j]);
        }
       System.out.println();
        }

    }

}


import java.util.Scanner;

/**
 *
 * @author Annie
 */
public class Crystal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        char a[][] = new char[7][7];

        for(int i =0;i<n;i++){
             for(int j =0;j<n;j++){
            a[i][j]='D';

        }
        }
        int x = n/2;

        for(int i=0;i<x;i++){
        for(int j=0;j<x-i;j++){
        a[i][j]='*';
          a[i][n-1-j]='*';
        }

        }

        int k=0;
        for(int i=n-1;i>=x+1;i--){
        for(int j=0;j<x-k;j++){
        a[i][j]='*';
          a[i][n-1-j]='*';
        }
       k++;
        }

        for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
       System.out.print(a[i][j]);
        }
       System.out.println();
        }

    }

}


//Omar brome, lcpc practice, codeforces: *
//basic code for fast java input/output learned from kattis

import java.util.*;
import java.io.*;

public class Main{
public static void main(String[] args){
Kattio tuna= new Kattio(System.in,System.out);
int n=tuna.getInt();
char[][]d=new char[n][n];
int end=0;
int start=0;
for (int i=0;i<n;i++)
Arrays.fill(d[i], '*');

for (int i=n/2;i>=0;i--){
    for (int j=0+end;j<n-end;j++){
        d[i][j]='D';
    }
    end++;
}

end=0;
for (int i=n/2;i<n;i++){
    for (int j=0+end;j<n-end;j++){
        d[i][j]='D';
    }
    end++;
}

for ( int i=0;i<n;i++){
    for (int j=0;j<n;j++)
        tuna.print(d[i][j]);
    tuna.println();
    }
tuna.flush();
}
}

class Kattio extends PrintWriter {
  public Kattio(InputStream i) {
    super(new BufferedOutputStream(System.out));
    r = new BufferedReader(new InputStreamReader(i));
  }
  public Kattio(InputStream i, OutputStream o) {
    super(new BufferedOutputStream(o));
    r = new BufferedReader(new InputStreamReader(i));
  }

  public boolean hasMoreTokens() {
    return peekToken() != null;
  }

  public int getInt() {
    return Integer.parseInt(nextToken());
  }

  public double getDouble() {
    return Double.parseDouble(nextToken());
  }

  public long getLong() {
    return Long.parseLong(nextToken());
  }

  public String getWord() {
    return nextToken();
  }

  private BufferedReader r;
  private String line;
  private StringTokenizer st;
  private String token;

  private String peekToken() {
    if (token == null)
        try {
        while (st == null || !st.hasMoreTokens()) {
            line = r.readLine();
            if (line == null) return null;
            st = new StringTokenizer(line);
        }
        token = st.nextToken();
        } catch (IOException e) { }
    return token;
  }

  private String nextToken() {
    String ans = peekToken();
    token = null;
    return ans;
  }
}


        import java.io.*;
        import java.util.*;
        public class cf454A {
            static PrintWriter out;
            public static void main(String[] args) throws IOException {
                MyScanner sc = new MyScanner();
                out = new PrintWriter(new BufferedOutputStream(System.out));
                int n = sc.nextInt();
                String quotes = "******************************************************************************************************".substring(0, n);
                String ds = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD".substring(0, n);
                StringBuilder sb = new StringBuilder();
                for(int i = n; i >= 2; i -=2){
                    sb.append(quotes.substring(0, i/2)+ds.substring(0, n-quotes.substring(0, i/2).length()*2)+quotes.substring(0, i/2)+((i!=3)?"\n":""));
                }
                out.println(sb);
                out.println(ds);
                out.println(sb.reverse());
                out.close();
            }
            static class MyScanner {
                BufferedReader br;
                StringTokenizer st;
                public MyScanner() {
                    br = new BufferedReader(new InputStreamReader(System.in));
                }
                String next() {
                    while (st == null || !st.hasMoreElements()) {
                        try {
                            st = new StringTokenizer(br.readLine());
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                    return st.nextToken();
                }
                int nextInt() {
                    return Integer.parseInt(next());
                }
                long nextLong() {
                    return Long.parseLong(next());
                }
                double nextDouble() {
                    return Double.parseDouble(next());
                }
                String nextLine() {
                    String str = "";
                    try {
                        str = br.readLine();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    return str;
                }
            }
        }


        import java.io.*;
        import java.util.*;
        public class cf454A {
            static PrintWriter out;
            public static void main(String[] args) throws IOException {
                MyScanner sc = new MyScanner();
                out = new PrintWriter(new BufferedOutputStream(System.out));
                int n = sc.nextInt();
                String quotes = "''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''".substring(0, n);
                String ds = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD".substring(0, n);
                StringBuilder sb = new StringBuilder();
                for(int i = n; i >= 2; i -=2){
                    sb.append(quotes.substring(0, i/2)+ds.substring(0, n-quotes.substring(0, i/2).length()*2)+quotes.substring(0, i/2)+((i!=3)?"\n":""));
                }
                out.println(sb);
                out.println(ds);
                out.println(sb.reverse());
                out.close();
            }
            static class MyScanner {
                BufferedReader br;
                StringTokenizer st;
                public MyScanner() {
                    br = new BufferedReader(new InputStreamReader(System.in));
                }
                String next() {
                    while (st == null || !st.hasMoreElements()) {
                        try {
                            st = new StringTokenizer(br.readLine());
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                    return st.nextToken();
                }
                int nextInt() {
                    return Integer.parseInt(next());
                }
                long nextLong() {
                    return Long.parseLong(next());
                }
                double nextDouble() {
                    return Double.parseDouble(next());
                }
                String nextLine() {
                    String str = "";
                    try {
                        str = br.readLine();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    return str;
                }
            }
        }


//package Codeforces.Div2A_259.Code1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/*
 * some cheeky quote
 */

public class Main
{
    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException
    {
        int n = in.nextInt();
        String a[] = new String[n];
        for (int i = 1; i <= n; i += 2)
        {
            String row = "";
            //Add D
            for (int j = 0; j < i; j++)
            {
                row += "D";
            }
            //Add *
            while (row.length() < n)
            {
                row = "*" + row + "*";
            }
            System.out.println(row);
        }
        for (int i = n - 2; i >= 1; i -= 2)
        {
            String row = "";
            for (int j = 0; j < i; j++)
            {
                row += "D";
            }
            while (row.length() < n)
            {
                row = "*" + row + "*";
            }
            System.out.println(row);
        }

    }

    public void run()
    {
        try
        {
            in = new FastScanner();
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e)
        {
            e.printStackTrace();
        }
    }

    class FastScanner
    {
        BufferedReader br;
        StringTokenizer st;

        FastScanner()
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreTokens())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }
    }

    public static void main(String[] arg)
    {
        new Main().run();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class LittlePonyAndCrystalMine {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(f.readLine());

		for (int i = 0; i < (n+1)/2; i++)
			System.out.println(f('*', n/2-i) + f('D', 2*i+1) + f('*', n/2-i));
		for (int i = n/2-1; i >= 0; i--)
			System.out.println(f('*', n/2-i) + f('D', 2*i+1) + f('*', n/2-i));

	}

	public static String f(char c, int x) {
		String str = "";
		for (int i = 0; i < x; i++)
			str += c;
		return str;
	}
}


import java.io.*;
import java.util.*;

public class Main {
public static int count(int[]ar,int s,int e, int c){

    for (int i = s; i <=e; i++) {

            if(ar[i]==0)c++;
            else c--;
    }
    return c;
}
    public static void main(String args[]) throws IOException {
        Reader.init(System.in);
        int n = Reader.nextInt();
        int i  = 1, l = (n-1)/2 , r =(n-1)/2;
        while(true){
            if(i>n){
                break;
            }
            for (int j = 0; j < l; j++) {
                System.out.print("*");
            }
            for (int j = 0; j < i; j++) {
                System.out.print("D");
            }
             for (int j = 0; j < r; j++) {
                System.out.print("*");
            }
             i+=2;
             l--;
             r--;
             System.out.println("");
        }

        l = r = 1;
        i = n-2;
        while(true){
            if(i<1)break;
            for (int j = 0; j < l; j++) {
                System.out.print("*");
            }
               for (int j = 0; j < i; j++) {
                System.out.print("D");
            }
                for (int j = 0; j < r; j++) {
                System.out.print("*");
            }
                i-=2;
                l++;r++;
                System.out.println("");

        }
    }
}

class dragons implements Comparable<dragons> {

    int power, bounes;

    public dragons(int p, int b) {
        this.power = p;
        this.bounes = b;
    }

    @Override
    public int compareTo(dragons o) {
        return Integer.compare(this.power, o.power);
    }

}

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /**
     * call this method to initialize reader for InputStream
     */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    /**
     * get next word
     */
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static public void nextIntArrays(int[]... arrays) throws IOException {
        for (int i = 1; i < arrays.length; ++i) {
            if (arrays[i].length != arrays[0].length) {
                throw new InputMismatchException("Lengths are different");
            }
        }
        for (int i = 0; i < arrays[0].length; ++i) {
            for (int[] array : arrays) {
                array[i] = nextInt();
            }
        }
    }

    static public void nextLineArrays(String[]... arrays) throws IOException {
        for (int i = 1; i < arrays.length; ++i) {
            if (arrays[i].length != arrays[0].length) {
                throw new InputMismatchException("Lengths are different");
            }
        }
        for (int i = 0; i < arrays[0].length; ++i) {
            for (String[] array : arrays) {
                array[i] = reader.readLine();
            }
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import main.InputReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author f0x
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.readInt();
        char[] s = new char[n];
        for (int i = 0; i < n; i++) {
            s[i] = '*';
        }
        int pos = n / 2, i;
        for (i = 0; pos + i < n; i++) {
            s[pos+i] = s[pos-i] = 'D';
            out.print(s);
            out.println();
        }
        i--;
        for ( ; i > 0; i--) {
            s[pos+i] = s[pos-i] = '*';
            out.print(s);
            out.println();
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author f0x
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.readInt();
        char[] s = new char[n];
        for (int i = 0; i < n; i++) {
            s[i] = '*';
        }
        int pos = n / 2, i;
        for (i = 0; pos + i < n; i++) {
            s[pos+i] = s[pos-i] = 'D';
            out.print(s);
            out.println();
        }
        i--;
        for ( ; i > 0; i--) {
            s[pos+i] = s[pos-i] = '*';
            out.print(s);
            out.println();
        }
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}


import java.io.*;
import java.math.*;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;

public class Main {

    InputReader in;
    PrintWriter out;

    void run(){
        /*try {
            out = new PrintWriter(new FileOutputStream("Aoutput.txt"));
            in = new InputReader(new FileInputStream("A-large.in"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }*/
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new InputReader(System.in);
        solve();
        out.flush();
    }

    public static void main(String[] args){
        new Main().run();
    }

    void solve() {
        int n = in.ni();
        char[][] c = new char[n][n];
        for(char[] y : c)
            Arrays.fill(y, '*');
        for(int i = 0; i < (n + 1) / 2; i++) {
            int mid = n / 2;
            c[i][mid] = 'D';
            c[n - i - 1][mid] = 'D';
            for(int j = 0; j <= i; j++) {
                c[i][mid - j] = c[i][mid + j] = 'D';
                c[n - i - 1][mid - j] = c[n - i - 1][mid + j] = 'D';
            }
        }
        for(char[] x : c)
            out.println(Arrays.toString(x));
    }

    class InputReader {
        private boolean finished = false;
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }

        public int ni() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nl() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String ns() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private String readLine0() {
            StringBuilder buf = new StringBuilder();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String readLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines)
                return readLine();
            else
                return readLine0();
        }

        public BigInteger readBigInteger() {
            try {
                return new BigInteger(ns());
            } catch (NumberFormatException e) {
                throw new InputMismatchException();
            }
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, ni());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, ni());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public boolean eof() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value == -1;
        }

        public String next() {
            return ns();
        }

        public SpaceCharFilter getFilter() {
            return filter;
        }

        public void setFilter(SpaceCharFilter filter) {
            this.filter = filter;
        }
    }
    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

}


import java.io.*;
import java.math.*;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;

public class Main {

    InputReader in;
    PrintWriter out;

    void run(){
        /*try {
            out = new PrintWriter(new FileOutputStream("Aoutput.txt"));
            in = new InputReader(new FileInputStream("A-large.in"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }*/
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new InputReader(System.in);
        solve();
        out.flush();
    }

    public static void main(String[] args){
        new Main().run();
    }

    void solve() {
        int n = in.ni();
        char[][] c = new char[n][n];
        for(char[] y : c)
            Arrays.fill(y, '*');
        for(int i = 0; i < (n + 1) / 2; i++) {
            int mid = n / 2;
            c[i][mid] = 'D';
            c[n - i - 1][mid] = 'D';
            for(int j = 0; j <= i; j++) {
                c[i][mid - j] = c[i][mid + j] = 'D';
                c[n - i - 1][mid - j] = c[n - i - 1][mid + j] = 'D';
            }
        }
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++)
                out.print(c[i][j]);
            out.println();
        }
    }

    class InputReader {
        private boolean finished = false;
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }

        public int ni() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nl() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String ns() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private String readLine0() {
            StringBuilder buf = new StringBuilder();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String readLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines)
                return readLine();
            else
                return readLine0();
        }

        public BigInteger readBigInteger() {
            try {
                return new BigInteger(ns());
            } catch (NumberFormatException e) {
                throw new InputMismatchException();
            }
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, ni());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, ni());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public boolean eof() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value == -1;
        }

        public String next() {
            return ns();
        }

        public SpaceCharFilter getFilter() {
            return filter;
        }

        public void setFilter(SpaceCharFilter filter) {
            this.filter = filter;
        }
    }
    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
    	int n = in.nextInt();
	int mid = (n / 2) + 1;
	int c = 1;
	for (int i = 0; i < mid - 1; i++) {
		// Stars to print
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		for (int j = 0; j < c; j++)
			out.print("D");
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		out.print("\n");
		c += 2;
	}
	for (int i = 0; i < n; i++)
		out.print("D");
	out.print("\n");
	for (int i = mid; i > 1; i--) {
		c -= 2;
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		for (int j = 0; j < c; j++)
			out.print("D");
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		out.print("\n");
	}

    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
    	int n = in.nextInt();
	int mid = (n / 2) + 1;
	int c = 1;
	for (int i = 0; i < mid - 1; i++) {
		// Stars to print
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		for (int j = 0; j < c; j++)
			out.print("D");
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		out.print("\n");
		c += 2;
	}
	for (int i = 0; i < n; i++)
		out.print("D");
	out.print("\n");
	for (int i = mid; i > 1; i--) {
		c -= 2;
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		for (int j = 0; j < c; j++) {
			out.print("D");
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		out.print("\n");
	}

    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
    	int n = in.nextInt();
	int mid = (n / 2) + 1;
	int c = 1;
	for (int i = 0; i < mid - 1; i++) {
		// Stars to print
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		for (int j = 0; j < c; j++)
			out.print("D");
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		out.print("\n");
		c += 2;
	}
	for (int i = 0; i < n; i++)
		out.print("D");
	out.print("\n");
	for (int i = mid; i > 1; i--)
		c -= 2;
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		for (int j = 0; j < c; j++) {
			out.print("D");
		for (int j = 0; j < (n - c) / 2; j++)
			out.print("*");
		out.print("\n");
	}

    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Solution {

	public static void main(String args[]) throws Exception {
		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		int beg;
		int end;
		beg = end = n/2;
		for(int i=0;i<=n/2;i++){
			for(int j=0;j<beg;j++)
				System.out.print("*");
			for(int j=0;j<n-(beg+end);j++)
				System.out.print("D");
			for(int j=0;j<end;j++)
				System.out.print("*");
			beg-=1;
			end-=1;
			System.out.println();
		}
		beg=end=1;
		for(int i=0;i<n/2;i++){
			for(int j=0;j<beg;j++)
				System.out.print("*");
			for(int j=0;j<n-(beg+end);j++)
				System.out.print("D");
			for(int j=0;j<end;j++)
				System.out.print("*");
			beg+=1;
			end+=1;
			System.out.println();
		}

	}

	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}

}


import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.*;

public class Hasan0504 {

    public static void main(String args[]) throws Exception {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        ArrayList<String> list = new ArrayList<String>();
        String S = "";
        for (int i = 0; i < n; i++) {
            S += "D";
        }// main
        list.add(S);
        String f = "";
        int x = 0;

        char[] c = S.toCharArray();
         for(int g=0;g<n;g++){
             c=S.toCharArray();
             f="";
       x++;
        for (int i = 0; i < x; i++) {
            c[i]='*';
        }// first
          int h=x;
          int m=c.length-1;
          while(h!=0){
              c[m]='*';
              m--;
              h--;
          }
         for (int w = 0; w < c.length; w++) {
            f+=String.valueOf(c[w]);

        }// main
         if(f.contains("D"))
         list.add(f);
         else
             break;
         }// main2
         for(int i=list.size()-1;i>=0;i--)
             System.out.println(list.get(i));
         list.remove(0);
         for(int i=0;i<list.size();i++)
             System.out.println(list.get(i));
    }
}


import java.awt.image.SinglePixelPackedSampleModel;
import java.util.*;

public class practise {

    /*
     * Scanner scanner = new Scanner(System.in); int NCase = scanner.nextInt();
     * String Input = scanner.next();
     */
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();

        int diamondCellsNumber = -1;
        int beginIndex;
        boolean increasingDiamondCells = true;
        for (int i = 0; i < n; i++) {

            if (increasingDiamondCells && diamondCellsNumber == n) {
                increasingDiamondCells = false;
            } else if (!increasingDiamondCells && diamondCellsNumber == 1) {
                increasingDiamondCells = true;
            }

            if (increasingDiamondCells) {
                diamondCellsNumber += 2;
            } else {
                diamondCellsNumber -= 2;
            }

            beginIndex = (n - diamondCellsNumber) / 2;

            for (int j = 0; j < beginIndex; j++) {

                System.out.print("*");
            }
            for (int k = beginIndex; k < beginIndex + diamondCellsNumber; k++) {
                System.out.print("D");
            }
            for (int l = beginIndex + diamondCellsNumber; l < n; l++) {
                System.out.print("*");
            }
            System.out.println();
        }

    }
}


import java.util.Scanner;
import java.io.OutputStream;
import java.io.IOException;
import java.io.FileOutputStream;
import java.util.Arrays;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream;
		try {
			inputStream = new FileInputStream("�?�?анда�?�?н�?й ввод");
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		OutputStream outputStream;
		try {
			outputStream = new FileOutputStream("�?�?анда�?�?н�?й в�?вод");
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
	public void solve(int testNumber, Scanner in, PrintWriter out) {
    int n = in.nextInt();
    char m[][] = new char[n][n];
    for (char[] x: m) Arrays.fill(x, '*');
    for (int i=0; i<n/2; i++)
      for (int j = n/2 - i; j <= n/2 + i; j++) {
        m[i][j] = 'D';
      }
    for (int i = n/2; i < n; i++) {
      for (int j = i - n/2; j < n - (i - n/2); j++) {
        m[i][j] = 'D';
      }
    }
    for (char[] x: m) {
      for (char c: x) out.print(c);
      out.println();
    }
	}
}


import java.io.*;
import java.util.Arrays;
public class Main {
	public static void main (String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			char m[][] = new char[n][n];
			for (char[] x: m) Arrays.fill(x, '*');
			for (int r = 0; r < n/2; r++)
				for (int c=(n/2) - r; c <= (n/2) + r; c++) m[r][c] = 'D';
			for (int r = n/2; r < n; r++)
				for (int c= r - (n/2); c < n - (r - (n/2)); c++) m[r][c] = 'D';
			for (char[] x: m) {
				for(char c: x) System.out.print(c);
				System.out.println();
			}
		} catch(IOException io){
			io.printStackTrace();
		}

	}
}


import java.io.*;
import java.util.Scanner;

/**
 * Created by panzer on 04.08.14.
 */
public class main {
    public static void main(String[] args) throws IOException{
        FileReader fr = new FileReader(new File("input.txt"));
        FileWriter fw = new FileWriter(new File("output.txt"));
        Scanner sc = new Scanner(fr);
        PrintWriter pw = new PrintWriter(fw);
        final int ans=sc.nextInt();
        String d = "D";
        String star = "*";
        if(ans <3 || ans>101 || ans%2==0){
            pw.print("!!!!");
        }else{
            String [][] matrix = new String[ans][ans];
            int middle=ans/2;
            int full = ans-1;
            for(int i=0;i<=ans/2;i++){
                for(int j=0;j<ans;j++){
                    if(i==0){
                        matrix[i][j]=star;
                        matrix[i][middle]=d;
                    }else{
                        matrix[i][j]=matrix[i-1][j];
                        matrix[i][middle+i]=d;
                        matrix[i][middle-i]=d;
                    }
                }
            }
            for(int i=0;i<ans/2;i++){
                for(int j=0;j<ans;j++){
                    matrix[full][j]=matrix[i][j];
                }
                full--;
            }
            for (int i=0;i<ans;i++){
                for (int j=0;j<ans;j++){
                    pw.print(matrix[i][j]);
                }
                pw.println();
            }
            pw.flush();

        }

    }
}


import java.io.*;
import java.util.Scanner;

/**
 * Created by panzer on 04.08.14.
 */
public class main {
    public static void main(String[] args) throws IOException{

        Scanner sc = new Scanner(System.in);
        final int ans=sc.nextInt();
        String d = "D";
        String star = "*";
        if(ans <3 || ans>101 || ans%2==0){
            System.out.println("!!!!!!!!!!!");
        }else{
            String [][] matrix = new String[ans][ans];
            int middle=ans/2;
            int full = ans-1;
            for(int i=0;i<=ans/2;i++){
                for(int j=0;j<ans;j++){
                    if(i==0){
                        matrix[i][j]=star;
                        matrix[i][middle]=d;
                    }else{
                        matrix[i][j]=matrix[i-1][j];
                        matrix[i][middle+i]=d;
                        matrix[i][middle-i]=d;
                    }
                }
            }
            for(int i=0;i<ans/2;i++){
                for(int j=0;j<ans;j++){
                    matrix[full][j]=matrix[i][j];
                }
                full--;
            }
            for (int i=0;i<ans;i++){
                for (int j=0;j<ans;j++){
                    System.out.print(matrix[i][j]);
                }
                System.out.println();
            }
        }

    }
}


import java.util.Scanner;
public class a {
  static Scanner truba=new Scanner(System.in);
  public static void main(String[] kolodets) {
    int n=truba.nextInt();
    int st=n/2,l=1,d=1;
    while(l<=n/2) {
      String sr="";
      for(int i=0;i<st;i++)
        sr+="*";
      String dd="";
      for(int i=0;i<d;i++)
        dd+="D";
      System.out.println(sr+dd+sr);
      st--;
      d+=2;
      l++;
    }
    String mid="";
    for(int i=0;i<n;i++)
      mid+="D";
    System.out.println(mid);
    l=n/2;
    st=1;
    d=n-2;
    while(l>=1) {
      String sr="";
      for(int i=0;i<st;i++)
        sr+="*";
      String dd="";
      for(int i=0;i<d;i++)
        dd+="D";
      System.out.println(sr+dd+sr);
      st++;
      d-=2;
      l--;
    }
  }
}


import java.util.Scanner;

/**
 ** Created by Alik on 10/25/2015.
 */
public class Problem_454A {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int size = in.nextInt();
        int middle = size / 2;
        for (int i = 0; i < size; i++){
            for (int j = 0; j < size; j++){
                if (i <= middle) {
                    if (j <= middle + i && j >= middle - i)
                        System.out.print("D");
                    else
                        System.out.print("*");
                }
                else{
                    if (j <= size - (i-middle)-1  && j >= i - middle)
                        System.out.print("D");
                    else
                        System.out.print("*");
                }
            }
            System.out.println();
        }
    }
}


import java.util.Scanner;

/**
 ** Created by Alik on 10/25/2015.
 */
public class Problem_454A {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int size = in.nextInt();
        int middle = size / 2;
        for (int i = 0; i < size; i++){
            for (int j = 0; j < size; j++){
                if (i <= middle) {
                    if (j <= middle + i && j >= middle - i)
                        System.out.print("D");
                    else
                        System.out.print("*");
                }
                else{
                    if (j <=size-i+2 && j >= i - middle)
                        System.out.print("D");
                    else
                        System.out.print("*");
                }
            }
            System.out.println();
        }
    }
}


import java.util.Scanner;

public class A454 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = (input.nextInt()-1)/2;
        StringBuilder output = new StringBuilder();
        for (int y=-N; y<=N; y++) {
            for (int x=-N; x<=N; x++) {
                output.append(Math.abs(x)+Math.abs(y) <= N ? 'D' : '*');
            }
            output.append('\n');
        }
        System.out.print(output);
    }

}


import java.util.Scanner;
public class A454 {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int n =in.nextInt(),j=0;
        for(int i = 0;i<n;i++){
            for(j = 0;j<Math.abs(i-n/2);j++)
                System.out.print("*");
            for(j=0;j<n-2*Math.abs(i-n/2);j++)
                System.out.print("D");
            for(j = 0;j<Math.abs(i-n/2);j++)
                System.out.print("*");
            System.out.println();
        }
    }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main {

	static PrintWriter out;

	static double EPS = 1e-9;
	static int INF = (int) 1e9;
	static long LINF = (long) 1e18;
	static int MOD = (int) 1e9 + 7;
	static double PI = 2 * Math.acos(0);

	static void solve() {
		int n = Input.nextInt();
		for (int i = 0; i < n; i++) {
			int k = 2 * Math.min(i, n - i - 1) + 1;
			int d = (n - k) >> 1;
			for (int j = 0; j < d; j++) {
				out.print("*");
			}
			for (int j = 0; j < k; j++) {
				out.print("D");
			}
			for (int j = 0; j < d; j++) {
				out.print("*");
			}
			out.println();
		}
	}

	public static void main(String[] args) {
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	static class Input {
		static StringTokenizer token = null;
		static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//		static BufferedReader in;
//		static {
//			try {
//				in = new BufferedReader(new FileReader("in.txt"));
//			} catch (IOException e) {
//			}
//		}

		static int nextInt() {
			return Integer.parseInt(nextString());
		}

		static long nextLong() {
			return Long.parseLong(nextString());
		}

		static double nextDouble() {
			return Double.parseDouble(nextString());
		}

		static String nextString() {
			try {
				while (token == null || !token.hasMoreTokens()) {
					token = new StringTokenizer(in.readLine());
				}
			} catch (IOException e) {
			}
			return token.nextToken();
		}
	}
}


/**
 *
 * @author Faruk
 */

import java.util.Arrays;
import java.util.Scanner;
import java.util.HashSet;
import java.util.HashMap;
import java.util.ArrayList;

public class tmp {
    public static void main(String [] args){
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        String [] arr = new String[n/2];
        char [] ar = new char[n];
        for(int i=0; i<n; i++)
            ar[i] = '*';

        for(int i =0; i<n/2; i++){
            ar[n/2 + i] = 'D';
            ar[n/2 - i] = 'D';
            arr[i] = new String(ar);
        }
        for(int i=0; i<n/2; i++)
            System.out.println(arr[i]);
        for(int i=1; i<=n; i++){
            System.out.print("D");
        }
        System.out.println();
        for(int i=n/2-1; i>=0; i--)
            System.out.println(arr[i]);

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class CF259_Little_Pony_and_Crystal_mine {
	public static void main(String[] args) {
		MyScanner in = new MyScanner();

		int n = in.nextInt();

		char[][] matrix = new char[n][n];

		int dPos = (int)Math.floor(n/2)-1;
		for(int i = 0; i < n; i++)
		{
			for(int j = 0; j < n; j++)
			{
				if(i < Math.floor(n/2))
				{
					if(j >= Math.floor(n/2)-i && j <= Math.floor(n/2)+i )
					{
						matrix[i][j] = 'D';
					}
					else
					{
						matrix[i][j] = '*';
					}

				}
				else if(i == Math.floor(n/2))
				{
					matrix[i][j] = 'D';
				}
				else
				{
					if(j >= Math.floor(n/2)-dPos && j <= Math.floor(n/2)+dPos)
					{
						matrix[i][j] = 'D';
					}
					else
					{
						matrix[i][j] = '*';
					}
				}
			}
			if(i > Math.floor(n/2))
			{
				dPos--;
			}
		}

		for(int i = 0; i < n; i++)
		{
			for(int j = 0; j < n; j++)
			{
				System.out.print(matrix[i][j]);
			}
			System.out.println("");
		}

	}

	// -----------MyScanner class for faster input----------
	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}
	// --------------------------------------------------------
}