Creating a variable in remote server

Can anyone help how to create a variable in remote server using shell script. i am connecting to remote server through ssh and creating a variable and assigning the value, but nothing is displayed when i run the script

Here is my script

ssh hostname <<EOF
 
a=10
echo $a
 
EOF

Well, << expands variables locally, so escape it with one '\'.