#include <iostream>
#include <cstdio>
void hanoi(char a, char b, char c, int n)
{
  if (n == 1)
  {
    std::printf("%c => %c\n",a,c);
  }
  else {
    hanoi(a,c,b, n-1);
    std::printf("%c => %c\n",a,c);
    hanoi(b,a,c, n-1);
  }
}
 
int main()
{
  int i;
  while (true)
  {
    std::cin>>i;
    if (i == 0 )
    {
      break;
    }
    else {
      hanoi('a','b', 'c', i);
    }
  }
}