\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}

$2^x$
$2_x$
$2^x_y$
$2_x^y$
$2^{x^y_z}$
$2^{w_x^y}$
${3+5}^x$
$x^100+y^32$
${x+y}{x-y}$
${{x}}^2$
${x^y}^z$
${x^{y^z}}$
\end{document}
