#include <stdio.h>
#include <math.h>
#define UP 1
#define DOWN 0
void myPrintf(int in_length, int in_order)
{
int cont, cont2;
char str[2] = "ab";
if (in_order == UP) {
for (cont = 1; cont < in_length; cont++) {
for (cont2 = 0; cont2 < cont; cont2++) {
if((cont2 % 2) == 0)
printf("%c", str[0]);
else
printf("%c", str[1]);
}
printf("\n");
}
} else if (in_order == DOWN) {
for (cont = in_length; cont > 0; cont--) {
for (cont2 = 0; cont2 < cont; cont2++) {
if((cont2 % 2) == 0)
printf("%c", str[0]);
else
printf("%c", str[1]);
}
printf("\n");
}
}
}
int main(int ac, char**av)
{
myPrintf(5, UP);
myPrintf(5, DOWN);
}