#!/usr/bin/python
# -*- coding: utf-8 -*-



from tkinter import Tk, Frame, Button, BOTH
from tkinter import *
from tkinter.ttk import *


class Example(Frame):
  
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent
        
        self.initUI()
        
    def initUI(self):
      
        self.parent.title("Quit button")
        self.style = Style()
        self.style.theme_use("default")

        self.pack(fill=BOTH, expand=1)

        quitButton = Button(self, text="Quit",
            command=self.quit)
        quitButton.place(x=50, y=50)

def rectangle(cols, rows, charODD, charEVEN):

	if (rows > 0):
		rectangle(cols, rows-1, charODD, charEVEN)
		#print('print row ', rows)
		if (rows %2 == 0):
			print(charEVEN * cols)
		else:
			print(charODD * cols)


def main():
  
   # root = Tk()
   # root.geometry("250x150+300+300")
   # app = Example(root)
   # root.mainloop()  
   rectangle(5, 8, 'X', 'O')
   print('---------------------------------------------')
   rectangle(7, 5, '~', '+')

if __name__ == '__main__':
    main()  