#include<bits/stdc++.h>
using namespace std;
int n,m,a[10][10],bx[25],by[25],ans;
int fx[2]={1,0};
int fy[2]={0,1};
void dfs(int x,int y,int step)
{
bx[step] = x;
by[step] = y;
if(x == n &&y == m)
{
ans++;
cout << ans << ":";
for(int i = 1; i <= step;i++)
{
cout << bx[i] << ","<<by[i];
if(i!=step) cout << "->";
}
cout << endl;
}
else
{
for(int i = 0; i < 2;i++)
{
int tx = x + fx[i];
int ty = y + fy[i];
if(tx >= 1 && tx <= n&&ty>= 1&& ty<= m)
{
dfs(tx,ty,step+1);
}
}
}
}
int main(){
cin >> n >>m;
dfs(1,1,1);
return 0;
}
/**************************************************************
Problem: 1360
User: yangwanning
Language: C++
Result: Accepted
Time:7 ms
Memory:2072 kb
****************************************************************/