Create every combination of variable groups up to order n SPECIFICATION

Given m variables, create every combination up to order n. For example, 

The output of mapping two variables (a and b) to order 1 would be:


a
b
a b


The output of mapping two variables (a and b) to order 2 would be:


a
a2
b
b2
a b
a2 b
a b2
a2 b2


The output of mapping two variables (a and b) to order 3 would be:


a
a2
a3
b
b2
b3
a b
a2 b
a3 b
a3 b2
a b2
a b3
a2 b3
a2 b2
a3 b3


The output of mapping three variables (a, b, and c) to order 1 would be:


a
b
c
a b
b c
a c
a b c


The output of mapping m variables to order n would be:


etc.


WINNING CRITERIA

Output every possible combination as outlined above. Order does not matter. Where in your code you print to the screen does not matter. All that matters is that what shows up in your output is correct.
LATEX, 354 bytes

When I saw this I knew it had to be done in Latex.  Equations just look so crisp and clean in Latex and I can't stand using ^ for power.

\documentclass{article}\input tikz\usepackage{intcalc}\usepackage{ifthen}\begin{document}\typein[\a]{}\typein[\b]{}\foreach\x in{1,...,\intcalcPow{\b+1}{\a}}{\begin{equation}\foreach[count=\i]\y in{a,...,z}{\ifthenelse{\(\i&lt;\a\)\OR\(\i=\a\)}{\y^\intcalcDiv{\intcalcMod{\x}{\intcalcPow{\b+1}{\i}}}{\intcalcPow{\b+1}{\i-1}}}{}}\end{equation}}\end{document}


Explanation

There are three main forces at work here \typein  which is what allows us to take input from the command line, the intcalc package which is what allows us to make calculations with our variables, and the Latexequation environment.



Once we have taken in input we begin a loop we loop \intcalcPow{\b+1}{\a} times, once for each result we want to print.  Each loop we begin an equation environment and loop through the alphabet keeping track of \y for the current letter and \i for the current number of runs.  If \i is greater than or equal to \a we don't print anything at all (according to the specs this is not strictly necessary however Latex will overflow for values greater than 1 if we don't do this).  We then print \y to our equation and raise it to the power of 

\intcalcDiv{\intcalcMod{\x}{\intcalcPow{\b+1}{\i}}}{\intcalcPow{\b+1}{\i-1}}


That whole mess simply means take the \ith digit of \x in base \b+1.  This ensures that the powers are decoded properly.

Example output:

Here is the output for 3, 2