import java.util.ArrayList;
public class Solution {
public static int[] alternateNumbers(int []a) {
// Write your code here.
ArrayList pos = new ArrayList<>();
ArrayList neg = new ArrayList<>();
for(int i=0; i<a.length; i++){
if (a[i] > 0) {
pos.add(a[i]);
} else {
neg.add(a[i]);
}
}
for(int i=0; i<a.length/2; i++){
a[2*i] =(int) pos.get(i);
a[2*i+1] =(int) neg.get(i);
}
return a;
}
}