#include<iostream>
using namespace std;
int n,m,k;
int u[10005],v[10005],w[10005];
int main(){
	freopen("road.in","r",stdin);
	freopen("road.out","w",stdout);
	cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		cin>>u[i]>>v[i]>>w[i];
	}
	for(int i=1;i<=k;i++){
		int c;
		cin>>c;
		for(int j=1;j<=n;j++){
			int xx;
			cin>>xx;
		}
	}
	cout<<0<<endl;
	return 0;
}
