#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include using namespace std; using namespace atcoder; using ll=long long; void IO(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main(){ IO(); ll n,m,k; cin>>n>>m>>k; vector s(k+1); for(ll i=0;i<=k;i++){ cin>>s[i]; s[i]--; } vector> dist(n,vector(n,1e18)); for(ll i=0;i>a>>b>>c; a--; b--; dist[a][b]=c; dist[b][a]=c; } for(ll l=0;l bit(k); for(ll i=0;i>q; while(q--){ ll t,x,y; cin>>t>>x>>y; if(t==1){ y--; if(x-1>=0){ bit.add(x-1,-dist[s[x-1]][s[x]]); } if(x+1<=k){ bit.add(x,-dist[s[x]][s[x+1]]); } s[x]=y; if(x-1>=0){ bit.add(x-1,dist[s[x-1]][s[x]]); } if(x+1<=k){ bit.add(x,dist[s[x]][s[x+1]]); } }else{ cout<