{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThere is a simple graph with an even number of edges. You need to represent it as a set of pairs of adjacent edges (having a common vertex).\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eInput contains a sequence of the pairs with the integers. The length of the sequence is even and is from 2 to 100000. Each pair of integers is the identifiers of vertices of one edge. All the identifiers are from 1 to 100000. It is guaranteed that there are neither loops nor multiple edges in the given graph.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIf a required decomposition exists, in the first line output an integer \u003ci\u003em\u003c/i\u003e that is a number of pairs of adjacent edges.\r\nThe following \u003ci\u003em\u003c/i\u003e lines should contain triples of integers \u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e, \u003ci\u003ec\u003c/i\u003e, representing the edges of the given graph {\u003ci\u003ea\u003c/i\u003e,\u0026nbsp;\u003ci\u003eb\u003c/i\u003e} and {\u003ci\u003eb\u003c/i\u003e,\u0026nbsp;\u003ci\u003ec\u003c/i\u003e}.\r\nIf there is no such decomposition, output ā-1ā.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 2\r\n2 3\r\n3 1\r\n1 10\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1 2 3\r\n3 1 10\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr\u003e\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 2\r\n2 3\r\n3 1\r\n4 10\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Notes","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThis problem is a more difficult version of the problem ā\u003ca href\u003d\"https://acm.timus.ru/problem.aspx?space\u003d1\u0026amp;num\u003d1320\"\u003eGraph Decomposition\u003c/a\u003eā.\u003c/div\u003e\u003c/div\u003e"}}]}