#include <iostream>
#include <math.h>
using namespace std;
struct coord
{
int x,y;
};
const int n=8;
int main()
{
int chessboard[n][n];
bool k;
string s0,s1;
int step=0;
coord start, finish;
cin>>s0>>s1;
start.x=(int)s0[0]-97;
start.y=s0[1]-49;
finish.x=(int)s1[0]-97;
finish.y=s1[1]-49;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
chessboard[i][j]=-1;
chessboard[start.x][start.y]=0;
k=true;
while(chessboard[finish.x][finish.y]==-1)
{
k=false;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
if(chessboard[i][j]==step)
{
for(int a=fmax(0,i-2);a<=fmin(n-1,i+2);a++)
for(int b=fmax(0,j-2);b<=fmin(n-1,j+2);b++)
if((chessboard[a][b]==-1)&&(((abs(i-a)==2)&&(abs(j-b)==1))||((abs(i-a)==1)&&(abs(j-b)==2))))
{
chessboard[a][b]=step+1;
k=true;
}
}
if(!k) chessboard[finish.x][finish.y]=0;
else step++;
}
if (chessboard[finish.x][finish.y]==0) cout<<"start=finish"<<endl;
else
{
coord path[8];
path[0].x=finish.x;
path[0].y=finish.y;
for(int i=0;i<step;i++)
{
int x=path[i].x;
int y=path[i].y;
for(int a=fmax(0,x-2);a<=fmin(n-1,x+2);a++)
for(int b=fmax(0,y-2);b<=fmin(n-1,y+2);b++)
if((chessboard[a][b]==chessboard[x][y]-1)&&(((abs(x-a)==2)&&(abs(y-b)==1))||((abs(x-a)==1)&&(abs(y-b)==2))))
{
path[i+1].x=a;
path[i+1].y=b;
}
}
for(int i=step;i>=0;i--)
cout<<(char)(path[i].x+97)<<path[i].y+1<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IGNvb3JkCgl7CgkJaW50IHgseTsKCX07CmNvbnN0IGludCBuPTg7CmludCBtYWluKCkKCXsKCQlpbnQgY2hlc3Nib2FyZFtuXVtuXTsKCQlib29sI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