#include<stdio.h>

#define max 6

int stack[max];

int top=-1;

void push(int data)

{

if(top==max-1)

{

printf("stack is full\n");

}

else{

top=top+1;

stack[top]=data;

}

}

int pop()

{

if(top==-1)

{

printf("stack is empty\n");

}

else{

int value=stack[top];

return value;

top=top-1;

}

}

void fact(int num) //PRIME FACTOR OF A NUMBER

{

int i=2;

while(num!=1)

{

while(num%i==0)

{

push(i);

num=num/i;

}

i++;

}

while(top!=-1)

{

printf("%d ",pop());

}

}

int main()

{

fact(120);

return 0;

}