#include #include using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) using mint = atcoder::modint998244353; using S = ll; S op(S a, S b){ return a + b; } S e(){ return 0; } using segtree = atcoder::segtree; int main(){ int n,m,k; cin>>n>>m>>k; vector s(k+1); rep(i,k+1) cin>>s.at(i); rep(i,k+1) s.at(i)--; vector> g(n,vector(n,1e18)); rep(i,m){ int a,b,c; cin>>a>>b>>c; a--; b--; g.at(a).at(b)=c; g.at(b).at(a)=c; } rep(i,n) g.at(i).at(i)=0; rep(i,n) rep(j,n) rep(l,n){ g.at(j).at(l)=min(g.at(j).at(l),g.at(j).at(i)+g.at(i).at(l)); } vector ss(k); rep(i,k) ss.at(i)=g.at(s.at(i)).at(s.at(i+1)); segtree seg(ss); int q; cin>>q; rep(Qi,q){ int t,x,y; cin>>t>>x>>y; if(t==1){ y--; s.at(x)=y; if(x>0) seg.set(x-1,g.at(s.at(x-1)).at(s.at(x))); if(x