Hello,
There's a very flexible way, using predefined(customer independent) communities and as-path-expand statement.
The point is that the AS number of your peer (from which the prefix you have received) will be prepended, not the AS number of the originating AS.
community prepend-1 65000:1;
community prepend-2 65000:2;
policy-statement prepend {
term prepend-1 {
from community prepend-1;
then as-path-expand last-as;
}
term prepend-2 {
from community prepend-2;
then as-path-expand last-as count 2;
}