import java.util.*;
public class Main{
public static void main(String[] args){
//1145 1155
Scanner in = new Scanner(System.in);
TreeMap<Integer,Integer> map = new TreeMap<>();
int n = in.nextInt(),m = in.nextInt();
while(n-->0){
int a = in.nextInt();
map.put(a,map.getOrDefault(a,0)+1);
}
while(m-->0){
int b = in.nextInt();
int min = map.firstKey();
int count = map.get(min);
if(count==1){
map.remove(min);
map.put(min+b,map.getOrDefault(min+b,0)+1);
}
else{
map.put(min,count-1);
map.put(min+b,map.getOrDefault(min+b,0)+1);
}
System.out.println(map.lastKey());
}
}
}