#include using namespace std; //#define int long long #define INF 1000000000 const int baza = 1<<20; struct drzewo { vector drz; drzewo() : drz( baza*2+10 ) {} int czytaj( int pyt_pocz, int pyt_kon, int pocz=0, int kon=baza, int gdzie = 1 ) { if( pyt_pocz <= pocz && kon <= pyt_kon ) { return drz[gdzie]; } if( pyt_kon <= pocz || kon <= pyt_pocz ) { return INF; } int sr = (pocz+kon)/2; return min( czytaj( pyt_pocz, pyt_kon, pocz, sr, gdzie*2 ), czytaj( pyt_pocz, pyt_kon, sr, kon, gdzie*2+1 ) ); } void zmien( int gdzie, int co ) { gdzie += baza; drz[gdzie] = co; gdzie/=2; while( gdzie ) { drz[gdzie] = min( drz[gdzie*2], drz[gdzie*2+1] ); gdzie/=2; } } void add( int gdzie, int ile ) { gdzie += baza; drz[gdzie] += ile; gdzie/=2; while( gdzie ) { drz[gdzie] = min( drz[gdzie*2], drz[gdzie*2+1] ); gdzie/=2; } } int znajdz( int gdzie=1 ) { if( gdzie>=baza ) return gdzie-baza; if( drz[gdzie*2] == 0 ) return znajdz( gdzie*2 ); return znajdz( gdzie*2+1 ); } }; drzewo t[2]; int dp[2][1000010]; void policz( int a, int b ) { for( int i=0; i<=1000000; i++ ) { if( i>a ) t[1].add( dp[1][i-a-1], -1 ); if( i>b ) t[0].add( dp[0][i-b-1], -1 ); dp[1][i] = t[0].znajdz(); dp[0][i] = t[1].znajdz(); t[1].add( dp[1][i], 1 ); t[0].add( dp[0][i], 1 ); } } int32_t main() { ios_base::sync_with_stdio( 0 ); cin.tie( 0 ); int n, a, b; cin >> n >> a >> b; policz( a, b ); int res = 0; for( int a, i=1; i<=n; i++ ) { cin >> a; res ^= dp[0][a]; } /*for( int i=0; i<20; i++ ) { cout << dp[0][i]; } //cout << endl; for( int i=0; i<20; i++ ) { cout << dp[1][i]; } //cout << endl;*/ if( res==0 ) { cout << "Varys"; } else { cout << "Petyr"; } return 0; } /* 2 3 4 2 3 * 7 8 9 1 2 3 4 5 6 7 * * * * 2 3 4 2 3 00120524288524288012221105242890110 00123300100052428852428852428800220 Petyrcteam065@acm ~ $ ./stones 7 8 9 1 2 3 4 5 6 7 001234567052428852428801234567 00123456788001234560 Petyr */