#include <bits/stdc++.h>

using namespace std;

int main()
{
    int ohio,final_boss;
    cin >> ohio >> final_boss;
    pair<int,int> amogus[final_boss];
    int sus[final_boss];
    for(int ohio1 = 0;ohio1<final_boss;ohio1++){
        cin >> amogus[ohio1].first >> amogus[ohio1].second >> sus[ohio1];
    }
    int poz1,poz2;
    cin >> poz1 >> poz2;
    cout << -1;

    return 0;
}