#include <bits/stdc++.h>
using namespace std;

vector <string> getMazePaths(int sr, int sc, int dr, int dc) {
        if(sr > dr || sc > dc){
            vector <string> bres;
            return bres;
        }

        if(sr == dr && sc == dc){
            vector <string> bres;
            bres.push_back("");
            return bres;
        }

        vector <string> paths;
        for(int move = 1; move <= dc - sc; move++){
            vector <string> hpaths = getMazePaths(sr, sc + move, dr, dc);
            for(string hpath: hpaths){
                paths.push_back("h" + move + hpath);
            }
        }
        
        for(int move = 1; move <= dr - sr; move++){
            vector <string> vpaths = getMazePaths(sr + move, sc, dr, dc);
            for(string vpath: vpaths){
                paths.push_back("v" + move + vpath);
            }
        }

        for(int move = 1; move <= dc - sc && move <= dr - sr; move++){
            vector <string> dpaths = getMazePaths(sr + move, sc + move, dr, dc);
            for(string dpath: dpaths){
                paths.push_back("d" + move + dpath);
            }
        }
        return paths;
}
                        
int main(){
    int n,m;
    cin>>n>>m;
    vector <string> paths = getMazePaths(0, 0, n - 1, m - 1);
    int count = 0;
    cout<<"[";
    for (string str : paths)
    {
        /* code */
        if(count != paths.size() - 1)
        cout<<str<<", ";
        else 
        cout<<str;
        count++;
    }
    cout<<"]";
    return 0;      
}