#include using namespace std; #include #include #include #include #include int main(void){ int a, times1; cin >> a >> times1; for(int i=0;i> b >> c; if(b==a){ a = c; } } cout <