#include <stdio.h>
#include <memory>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <time.h>
#include <limits>
using namespace std;
#define N 1005
struct e{
int v;
e* nxt;
}es[N*2];
e* fir[N];
int en, n, st, l;
bool state[N];
inline void add_e(int u, int v){
es[en].v = v; es[en].nxt = fir[u]; fir[u] = &es[en++];
}
bool input(){
if(scanf("%d%d", &n, &st) == EOF) return false;
st--;
int i, u, v;
for(i = 0; i < n; i++) fir[i] = NULL;
en = 0;
for(i = 1; i < n; i++){
scanf("%d%d", &u, &v);
u--;
v--;
add_e(u, v);
add_e(v, u);
}
return true;
}
void dfs(int u, int fa){
e* cur;
int v;
bool hasSon = false;
for(cur = fir[u]; cur; cur = cur->nxt){
if((v = cur->v) != fa){
hasSon = true;
dfs(v, u);
}
}
if(!hasSon){
state[u] = false; //必败态
}else{
state[u] = false;
for(cur = fir[u]; cur; cur = cur->nxt){
if((v = cur->v) != fa){
if(!state[v]){
if(u == st){
if(state[u]){
if(l > v + 1) l = v + 1;
}else{
state[u] = true;
l = v + 1;
}
}else state[u] = true;
}
}
}
}
}
void solve(){
dfs(st, -1);
if(state[st]) printf("First player wins flying to airport %d\n", l);
else printf("First player loses\n");
}
int main(){
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif
while(input()) solve();
return 0;
}