#include <bits/stdc++.h>
//trebam jos samo napraviti kad je neki broj prvi
using namespace std;

#define ll long long
#define ld long double
#define vt vector
#define pb push_back
#define all(a) a.begin(),a.end()
#define sz(x) (int)x.size()

const int MOD=1000000007;
const int mxN=2e5+5;

int a[mxN];

void solve(){
    int n,m;
    cin >> n >> m;
    int a,b,t;
    for(int i=0; i<m; ++i){
        cin >> a >> b >> t;
    }
    int u,v;
    cin >> u >> v;
    cout << 1 << "\n";
}

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

	int t=1;
	//cin >> t;
	while(t--){
        solve();
	}
}