you city consist n intersection number 0 n 1 bidirectional road intersection the input generate reach intersection intersection road intersectionsyou give integ n 2D integer array road roadsi ui vi timei mean road intersection ui vi take timei minute travel you want know way travel intersection 0 intersection n 1 short timereturn number way arrive destination short time since answer large return modulo 109 7 Example 1input n 7 road 067012123133633351651251045462output 4explanation the short time take intersection 0 intersection 6 7 minutesthe way 7 minute 0 6 0 4 6 0 1 2 5 6 0 1 3 5 6example 2input n 2 road 1010output 1explanation there way intersection 0 intersection 1 take 10 minute Constraints1 n 200n 1 roadslength n n 1 2roadsilength 30 ui vi n 11 timei 109ui viThere road connect intersectionsyou reach intersection intersection