// Arup Guha
// 10/16/2013
// Solution to 2012 South East Regional Division 1 Problem G: Heads or Tails

import java.util.*;
import java.math.*;

public class g {

	public static int rows;
	public static int cols;
	public static int steps;
	public static int low;
	public static int high;
	public static long rank;
	public static int squares;
	public static int C;
	public static int S;
	public static int B;
	public static double[][] expC;
	public static double[][] expS;
	public static double[][] expM;

	public static long[][] choose;

	public static void main(String[] args) {

		// We will use binomial coefficients later.
		choose = new long[63][63];
		filltri();

		Scanner stdin = new Scanner(System.in);

		read(stdin);
		while (rows != 0) {

			// Number of values in (C)corner, (S)sides and (B)body.
			if (rows > 1 && cols > 1) {

				C = 4;
				S = 2*(rows-2)+2*(cols-2);
				B = squares - C - S;

				// Get expectations for each group.
				expC = getExp(C, 3);
				expS = getExp(S, 4);
				expM = getExp(B, 5);
			}

			//  Single row, C, S and B have different formulas.
			else if (rows > 1 || cols > 1){
				C = 2;
				S = Math.max(rows, cols) - 2;
				B = 0;
				expC = getExp(C, 2);
				expS = getExp(S, 3);
				expM = getExp(B, 4); // dummy line
			}

			// Brute force for 1 x 1 case!!!
			else {

				// Break down our 1 x 1 box into cases.
				if (low == 0 && high == 1) {
					if (rank == 1) System.out.println("H");
					else System.out.println("T");
				}
				else if (low == 0 && high == 0) {
					if (steps%2 == 1) System.out.println("H");
					else System.out.println("T");
				}
				else {
					if (steps%2 == 1) System.out.println("T");
					else System.out.println("H");
				}

				// We already solved the case, so continue;
				read(stdin);
				continue;
			}

			// Store which frequencies of each type of box satisfy the expectation constraints.
			boolean[][][] valid = new boolean[C+1][S+1][B+1];
			for (int i=0; i<=C; i++) {
				for (int j=0; j<=S; j++) {
					for (int k=0; k<=B; k++) {
						double thisExp = expC[steps][i] + expS[steps][j] + expM[steps][k];
						valid[i][j][k] = thisExp >= low && thisExp <= high;
					}
				}
			}

			// Solve this!
			boolean[][] grid = solve(valid, rank);
			print(grid);

			// Get next case.
			read(stdin);
		}
	}

	// Fills in pascal's triangle for binomial coefficients.
	public static void filltri() {
		for (int i=0; i<choose.length; i++) {
			choose[i][0] = 1;
			choose[i][i] = 1;
		}
		for (int i=2; i<choose.length; i++)
			for (int j=1; j<i; j++)
				choose[i][j] = choose[i-1][j-1] + choose[i-1][j];
	}

	public static boolean isCorner(int r, int c) {
		return (r == 0 || r == rows-1) && (c == 0 || c == cols-1);
	}

	public static boolean isSide(int r, int c) {
		return (r == 0 || r == rows-1 || c == 0 || c == cols-1) && !isCorner(r,c);
	}

	public static boolean[][] solve(boolean[][][] valid, long rank) {

		// Store result here.
		boolean[][] ans = new boolean[rows][cols];

		int cHeads = 0, sHeads = 0, bHeads = 0;
		int numCLeft = C, numSLeft = S, numBLeft = B;

		// Assign each bit, one by one.
		for (int bit=0; bit<rows*cols; bit++) {

			// Parse out position.
			int x = bit/cols;
			int y = bit%cols;

			// Subtract this one from the count.
			if (isCorner(x,y)) { numCLeft--; cHeads++; }
			else if (isSide(x,y)) { numSLeft--; sHeads++; }
			else { numBLeft--; bHeads++; }

			long rankOn = 0;

			// Calculate how many combinations there are with this bit turned to heads.
			for (int i=0; i<=C; i++) {
				for (int j=0; j<=S; j++) {
					for (int k=0; k<=B; k++) {
						if (valid[i][j][k]) {
							int hLeftC = i - cHeads;
							int hLeftS = j - sHeads;
							int hLeftB = k - bHeads;
							if (hLeftC < 0 || hLeftS < 0 || hLeftB < 0) continue;
							long combos = choose[numCLeft][hLeftC]*choose[numSLeft][hLeftS]*choose[numBLeft][hLeftB];
							rankOn += combos;
						}
					}
				}
			}

			// Set bit.
			if (rankOn >= rank)
				ans[x][y] = false;

			// In this case we have to adjust rank as well.
			else {
				ans[x][y] = true;
				rank -= rankOn;
				if (isCorner(x,y)) cHeads--;
				else if (isSide(x,y)) sHeads--;
				else bHeads--;
			}
		}

		return ans;
	}

	// Prints grid in the desired format. H = false, T = true.
	public static void print(boolean[][] grid) {
		for (int i=0; i<grid.length; i++) {
			for (int j=0; j<grid[0].length; j++)
				if (grid[i][j]) System.out.print("T");
				else            System.out.print("H");
			System.out.println();
		}
	}

	public static double[][] getExp(int max, int change) {

		double[][] exp = new double[steps+1][max+1];

		// First row is all possible settings for # of heads.
		for (int i=0; i<exp[0].length; i++)
			exp[0][i] = i;

		// Calculate expectation after i moves based on i-1 moves.
		for (int i=1; i<=steps; i++)
			for (int j=0; j<exp[0].length; j++)
				exp[i][j] = exp[i-1][j]*(squares-change)/squares +
					        (max-exp[i-1][j])*change/squares;

		return exp;
	}

	public static void read(Scanner stdin) {
		rows = stdin.nextInt();
		cols = stdin.nextInt();
		steps = stdin.nextInt();
		low = stdin.nextInt();
		high = stdin.nextInt();
		rank = stdin.nextLong();
		squares = rows*cols;
	}
}