using System; using System.IO; using System.Collections; using System.Collections.Generic; class Example { static int [] l = new int [9]; // поточні номери ребер у списках суміжності static List> b = new List>();// списки суміжності static bool [] neo = new bool [9]; // мітки "нова вершина" static string answer=""; public static void step (int v) { while (l[v] < b[v].Count) { int w= b[v][l[v]]; l[v]++; if (neo[w]) { neo[w]=false; answer+=Convert.ToString(v)+" "+Convert.ToString(w)+"\n"; step(w); } } } public static void Main() { try { int nv,ne,// вхідні дані з першого рядка v0, // корінь каркасного дерева - початкова вершина j,k,m; // лічильники using (StreamReader file = new StreamReader("input.txt")) { string[] s = file.ReadLine().Split(' '); nv = Int32.Parse(s[0]); ne = Int32.Parse(s[1]); for (j=0; j()); for (m=0; m