#include <bits/stdc++.h>

using namespace std;


int main()
{
   int  n,m;
   cin>>n>>m;
   vector<int>a(m);
   vector<int>b(m);
   vector<int>t(m);
   int u,v;
   for(int i=0;i<m;i++){
    cin>>a[i];
    cin>>b[i];
    cin>>t[i];
   }
   cin>>u>>v;
   cout<<-1<<endl;
   return 0;
}