using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace yukicore { internal class Program { private static void Main(string[] args) { bool[] flags = new bool[3]; int No = Console.ReadLine()[0]-49; bool f = false; flags[No] = true; Console.ReadLine(); while (true) { var tmp = Console.ReadLine(); if (tmp == null || tmp == "") break; // nums = tmp.Split(' ').Select(x => int.Parse(x)-1).ToArray(); int n0 = tmp[0]-49; int n1= tmp[2]-49; f = flags[n0]; flags[n0] = flags[n1]; flags[n1] = f; } for (int i = 0; i <3; i++) if (flags[i]) Console.WriteLine(i+1); } } }