import java.util.; import java.io.; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = null; while((str = in.readLine())!=null){ String[] arr = str.split(" "); int n = Integer.parseInt(arr[0]); int m = Integer.parseInt(arr[1]); String[] res = in.readLine().split(" "); long[] dest = new long[n+2]; long[] dest1 = new long[n+2]; for(int i = 0;i < n;i++){ dest1[i+1]= Long.parseLong(res[i]); } for(int i = 0;i < m;i ++){ String[] temp = in.readLine().split(" "); int l = Integer.parseInt(temp[0]); int r = Integer.parseInt(temp[1]); long k = Long.parseLong(temp[2]); dest[l] += k; dest[r+1] -= k; } long sum = 0; for(int i = 1;i <=n;i++){ sum += dest[i]; dest1[i] += sum; System.out.print(dest1[i] + " "); }

        System.out.println();
    }
}

}