#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const ll INF = 1e17;

struct edge{ll to,cost;};
 
void dijkstra(vector<vector<edge> > &graph, int start, VL &d){
    int n = graph.size();
    d.assign(n, INF);
    d[start] = 0;
    priority_queue<PL, vector<PL>, greater<PL> > q;
    q.push(make_pair(0, start));
    while (!q.empty()){
        PL a = q.top();
        q.pop();
        int now = a.second;
        if(d[now] < a.first) continue;
        REP(i,graph[now].size()){
            edge e = graph[now][i];
            int next = e.to;
            if (d[next] > d[now] + e.cost){
                d[next] = d[now] + e.cost;
                q.push(make_pair(d[next], next));
            }
        }
    }
}

int main() {
    int n, m, k;
    cin >> n >> m >> k;
    VI p(n), c(n), j(n);
    REP(i,n) p[i] = in();
    REP(i,n) c[i] = in() - 1;
    REP(i,n) j[i] = in();

    vector<vector<edge>> e(n), e2(2 * n);
    REP(i,m){
        int u = in() - 1, v = in() - 1, t = in();
        e[u].push_back(edge{v, t});
        e[v].push_back(edge{u, t});
        // e2[u].push_back(edge{v, t});
        // e2[v].push_back(edge{u, t});
        e2[n + u].push_back(edge{n + v, t});
        e2[n + v].push_back(edge{n + u, t});
    }
    // REP(i,n) e2[i].push_back(edge{n + i, -p[i]});
    VL dist, cost;
    dijkstra(e, 0, dist);
    REP(i,n) e2[0].push_back(edge{n + i, dist[i] - p[i]});
    dijkstra(e2, 0, cost);

    // REP(i,n) cout << dist[i] << " ";
    // cout << endl;
    // REP(i,2*n) cout << cost[i] << " ";
    // cout << endl;

    VL ans(k, -INF);
    REP(i,n){
        ll tmp = j[i] - dist[i] - cost[n + i];
        chmax(ans[c[i]], tmp);
    }
    REP(i,k) printf("%lld\n", ans[i]);

    return 0;
}

