import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Washoum
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BLectureSleep solver = new BLectureSleep();
        solver.solve(1, in, out);
        out.close();
    }

    static class BLectureSleep {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int k = sc.nextInt();
            int[] tab = new int[n];
            for (int i = 0; i < n; i++) {
                tab[i] = sc.nextInt();
            }
            int[] t = new int[n];
            for (int i = 0; i < n; i++) {
                t[i] = sc.nextInt();
            }

            int act = 0;
            for (int i = 0; i < n; i++) {
                if (t[i] == 1) {
                    act += tab[i];
                }
            }
            int plus = 0;
            int minus = 0;
            for (int i = 0; i < k; i++) {
                if (t[i] == 1) {
                    minus += tab[i];
                }
                plus += tab[i];
            }
            int tmp;
            int ans = 0;
            for (int i = 0; i < n - k + 1; i++) {
                if (i != 0) {
                    plus -= tab[i - 1];
                    plus += tab[i + k - 1];
                    if (t[i - 1] == 1) {
                        minus -= tab[i - 1];
                    }
                    if (t[i + k - 1] == 1) {
                        minus += tab[i + k - 1];
                    }
                }
                tmp = act;
                tmp = tmp + plus - minus;
                ans = Math.max(tmp, ans);
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.*;
import java.util.*;

public class A
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args)
    {
        FastReader sc=new FastReader();
        int n=sc.nextInt();
        int k=sc.nextInt();

        int[] tab=new int[n];
        for (int i=0;i<n;i++) tab[i]=sc.nextInt();

        int[] t=new int[n];
        for (int i=0;i<n;i++) t[i]=sc.nextInt();

        int max=0;
        int sum;
        for (int i=0;i<=n-k;i++) {
        	sum=0;
        	for (int j=0;j<k;j++) {
        		if (t[i+j]==0)
        			sum+=tab[i];
        	}
        	if (sum>max) max=sum;
        }
        int awake=0;
        for (int i=0;i<n;i++) {
        	if (t[i]==1)
        			awake+=tab[i];
        	}
        System.out.println(awake+max);

    }
}


import java.io.*;
import java.util.*;

public class A
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args)
    {
        FastReader sc=new FastReader();
        int n=sc.nextInt();
        int k=sc.nextInt();

        int[] tab=new int[n];
        for (int i=0;i<n;i++) tab[i]=sc.nextInt();

        int[] t=new int[n];
        for (int i=0;i<n;i++) t[i]=sc.nextInt();

        int max=0;
        int sum;
        for (int i=0;i<n-k;i++) {
        	sum=0;
        	for (int j=0;j<k;j++) {
        		if (t[i+j]==0)
        			sum+=tab[i];
        	}
        	if (sum>max) max=sum;
        }
        int awake=0;
        for (int i=0;i<n;i++) {
        	if (t[i]==1)
        			awake+=tab[i];
        	}
        System.out.println(awake+max);

    }
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e6 + 22;
int n, ff = 0, t[N];

void add(int v, int vl, int vr, int pos, int value){
    if(vl == vr) t[v] = value;
    else{
        int vm = vl + (vr - vl) / 2;
        if(pos <= vm) add(2 * v + 1, vl, vm, pos, value);
        else add(2 * v + 2, vm + 1, vr, pos, value);
        t[v] = t[2 * v + 1] + t[2 * v + 2];
    }
}

int get(int v, int vl, int vr, int l, int r){
    if(vl > r || vr < l) return 0;
    else if(vl >= l && vr <= r) return t[v];
    else{
        int vm = vl + (vr - vl) / 2;
        return get(2 * v + 1, vl, vm, l , r) + get(2 * v + 2, vm + 1, vr, l, r);
    }
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++){
        int x;
        cin >> x;
        x--;
        ff += get(0, 0, n - 1, x, n - 1);
        add(0, 0, n - 1, x, 1);
    }
    if(ff % 2) cout << "Petr\n";
    else cout << "Um_nik\n";
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e6 + 22;
long long n, ff = 0, t[4 * N];

void add(int v, int vl, int vr, int pos, int value){
    if(vl == vr) t[v] = value;
    else{
        int vm = vl + (vr - vl) / 2;
        if(pos <= vm) add(2 * v + 1, vl, vm, pos, value);
        else add(2 * v + 2, vm + 1, vr, pos, value);
        t[v] = t[2 * v + 1] + t[2 * v + 2];
    }
}

int get(int v, int vl, int vr, int l, int r){
    if(vl > r || vr < l) return 0;
    else if(vl >= l && vr <= r) return t[v];
    else{
        int vm = vl + (vr - vl) / 2;
        return get(2 * v + 1, vl, vm, l , r) + get(2 * v + 2, vm + 1, vr, l, r);
    }
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++){
        int x;
        cin >> x;
        x--;
        ff += get(0, 0, n - 1, x, n - 1);
        add(0, 0, n - 1, x, 1);
    }
    if(ff % 2 == n % 2) cout << "Petr\n";
    else cout << "Um_nik\n";
}


#include <bits/stdc++.h>

using namespace std;

int n, ff = 0;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++){
        int x;
        cin >> x;
        if(i == x) ff++;
    }
    if(ff <= 30) cout << "Petr\n";
    else cout << "Um_nik\n";
}


        #include <bits/stdc++.h>
        #define endl '\n'
        #define modulo 1000000007
        #define int long long
        #pragma GCC optimize("-Ofast")
        #define float double
        #define PI acos(-1);
        #define sinDegrees(x) sin((x) * PI / 180.0)
        #define tanDegrees(x) tan((x) * PI / 180.0)
        #define atanDegrees(x) atan(x)* 180.0 / PI
        using namespace std;
        int power(int x,int y,int m)
        {
        int temp;
        if(y == 0)
        return 1;
        temp = (power(x, y/2,m))%m;
        if (y%2 == 0)
        return ((temp%m)*temp);
        else
        return ((x*temp%m)*temp%m)%m;
        }
        int inv(int x)
        {
        return (power(x,modulo-2,modulo))%modulo;
        }
        int counter;
        bool comp(int a,int b)
        {
        counter+=a<b;
        return a<b;
        }
        ///Solution created by:Ahmadsm2005
        int32_t main()
        {
            //freopen("output.txt","w", stdout);
            //freopen("input0.txt","r", stdin);
            iostream::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            int n;
            cin>>n;
            int arr[n];
            for(int i=0;i<n;i++){
            cin>>arr[i];
            }
            sort(arr,arr+n,comp);
            if(((n*3)-counter)&1)
            cout<<"Um_nik";
            else if(((n*7+1)-counter)&1)
            return -1;
            cout<<"Petr";
            return 0;
        }


        #include <bits/stdc++.h>
        #define endl '\n'
        #define modulo 1000000007
        #define int long long
        #pragma GCC optimize("-Ofast")
        #define float double
        #define PI acos(-1);
        #define sinDegrees(x) sin((x) * PI / 180.0)
        #define tanDegrees(x) tan((x) * PI / 180.0)
        #define atanDegrees(x) atan(x)* 180.0 / PI
        using namespace std;
        int power(int x,int y,int m)
        {
        int temp;
        if(y == 0)
        return 1;
        temp = (power(x, y/2,m))%m;
        if (y%2 == 0)
        return ((temp%m)*temp);
        else
        return ((x*temp%m)*temp%m)%m;
        }
        int inv(int x)
        {
        return (power(x,modulo-2,modulo))%modulo;
        }
        int counter;
        bool comp(int a,int b)
        {
        return a<b;
        }
        ///Solution created by:Ahmadsm2005
        int32_t main()
        {
            //freopen("output.txt","w", stdout);
            //freopen("input0.txt","r", stdin);
            iostream::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            int n;
            cin>>n;
            int arr[n];
            map<int,int>lol;
            for(int i=0;i<n;i++){
            cin>>arr[i];
            lol.insert({arr[i],i});
            }
            for(int i=0;i<n;i++){
            if(arr[i]!=(lol.begin()->first)){
            lol.at(arr[i])=(lol.begin()->second);
            swap(arr[i],arr[lol.begin()->second]);
            counter++;
            }
            lol.erase(lol.begin());
            }
            if((n*3-counter)&1)
            cout<<"Um_nik";
            else
            cout<<"Petr";
            return 0;
        }


        #include <bits/stdc++.h>
        #define endl '\n'
        #define modulo 1000000007
        #define int long long
        #pragma GCC optimize("-Ofast")
        #define float double
        #define PI acos(-1);
        #define sinDegrees(x) sin((x) * PI / 180.0)
        #define tanDegrees(x) tan((x) * PI / 180.0)
        #define atanDegrees(x) atan(x)* 180.0 / PI
        using namespace std;
        int power(int x,int y,int m)
        {
        int temp;
        if(y == 0)
        return 1;
        temp = (power(x, y/2,m))%m;
        if (y%2 == 0)
        return ((temp%m)*temp);
        else
        return ((x*temp%m)*temp%m)%m;
        }
        int inv(int x)
        {
        return (power(x,modulo-2,modulo))%modulo;
        }
        int counter;
        bool comp(int a,int b)
        {
        counter+=a<b;
        return a<b;
        }
        ///Solution created by:Ahmadsm2005
        int32_t main()
        {
            //freopen("output.txt","w", stdout);
            //freopen("input0.txt","r", stdin);
            iostream::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            int n;
            cin>>n;
            int arr[n];
            for(int i=0;i<n;i++){
            cin>>arr[i];
            }
            sort(arr,arr+n,comp);
            if(((n*3)-counter)&1)
            cout<<"Um_nik";
            else
            cout<<"Petr";
            return 0;
        }


        #include <bits/stdc++.h>
        #define endl '\n'
        #define modulo 1000000007
        #define int long long
        #pragma GCC optimize("-Ofast")
        #define float double
        #define PI acos(-1);
        #define sinDegrees(x) sin((x) * PI / 180.0)
        #define tanDegrees(x) tan((x) * PI / 180.0)
        #define atanDegrees(x) atan(x)* 180.0 / PI
        using namespace std;
        int power(int x,int y,int m)
        {
        int temp;
        if(y == 0)
        return 1;
        temp = (power(x, y/2,m))%m;
        if (y%2 == 0)
        return ((temp%m)*temp);
        else
        return ((x*temp%m)*temp%m)%m;
        }
        int inv(int x)
        {
        return (power(x,modulo-2,modulo))%modulo;
        }
        int counter;
        bool comp(int a,int b)
        {
        counter+=a<b;
        return a<b;
        }
        ///Solution created by:Ahmadsm2005
        int32_t main()
        {
            //freopen("output.txt","w", stdout);
            //freopen("input0.txt","r", stdin);
            iostream::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            int n;
            cin>>n;
            int arr[n];
            for(int i=0;i<n;i++){
            cin>>arr[i];
            }
            sort(arr,arr+n,comp);
            if(((n*3)-counter)%2==0)
            cout<<"Petr";
            else if(((n*7+1)-counter)&1)
            return -1;
            else
            cout<<"Um_nik";
            return 0;
        }


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    int cur = i;
    if (!vis[cur]) {
      while (!vis[cur]) {
        vis[cur] = true;
        cur = a[cur];
        ++nc;
      }
    }
  }
  if (nc & 1 ^ n & 1) {
    cout << "Um_nik" << endl;
  } else {
    cout << "Petr" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    if (i == a[i]) continue;
    int cur = i;
    while (!vis[cur]) {
      vis[cur] = true;
      cur = a[cur];
    }
    ++nc;
  }
  if (nc & 1 ^ n & 1) {
    cout << "Petr" << endl;
  } else {
    cout << "Um_nik" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    int cur = i;
    if (!vis[cur]) {
      while (!vis[cur]) {
        vis[cur] = true;
        cur = a[cur];
        ++nc;
      }
    }
  }
  cout << nc << endl;
  if (nc & 1 ^ n & 1) {
    cout << "Um_nik" << endl;
  } else {
    cout << "Petr" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    if (!vis[i]) {
      int cur = i;
      while (!vis[cur]) {
        vis[cur] = true;
        cur = a[cur];
     }
      ++nc;
    }
  }
  if (nc & 1 ^ n & 1) {
    cout << "Petr" << endl;
  } else {
    cout << "Um_nik" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    if (i == a[i]) continue;
    if (vis[cur]) continue;
    int cur = i;
    while (!vis[cur]) {
      vis[cur] = true;
      cur = a[cur];
    }
    ++nc;
  }
  if (nc & 1 ^ n & 1) {
    cout << "Um_nik" << endl;
  } else {
    cout << "Petr" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    if (i == a[i]) continue;
    if (vis[i]) continue;
    int cur = i;
    while (!vis[cur]) {
      vis[cur] = true;
      cur = a[cur];
    }
    ++nc;
  }
  if (nc & 1 ^ n & 1) {
    cout << "Um_nik" << endl;
  } else {
    cout << "Petr" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    int cur = i;
    if (!vis[cur]) {
      while (!vis[cur]) {
        vis[cur] = true;
        cur = a[cur];
        ++nc;
      }
      --nc;
    }
  }
  if (nc & 1 ^ n & 1) {
    cout << "Um_nik" << endl;
  } else {
    cout << "Petr" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    if (i == a[i]) continue;
    int cur = i;
    while (!vis[cur]) {
      vis[cur] = true;
      cur = a[cur];
    }
    ++nc;
  }
  if (nc & 1 ^ n & 1) {
    cout << "Um_nik" << endl;
  } else {
    cout << "Petr" << endl;
  }
  return 0;
}


#define CIN_ONLY 1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1000000007;
const ld PI = acos(ld(-1));

const int N = 1000001;

int a[N];
bool vis[N];

int main()
{
  if (CIN_ONLY) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nc = 0;
  for (int i = 0; i < n; ++i) {
    if (!vis[i]) {
      int cur = i;
      do {
        vis[cur] = true;
        cur = a[cur];
      } while (!vis[cur]);
      ++nc;
    }
  }
  if (nc & 1 ^ n & 1) {
    cout << "Petr" << endl;
  } else {
    cout << "Um_nik" << endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#include<unistd.h>
#define ST first
#define ND second
#define ll long long
using namespace std;

const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
const long long LINF = (ll)1e18 + 3;

void test(){

}

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	random_device device;
    mt19937 generator(device());
	int n; cin >> n;
	uniform_int_distribution<int> gen(0,n-1);
	//gen(generator); // generate random number
	vector<int> arr(n);
	for(int i = 0; i < n; i++) cin >> arr[i];
	vector<int> tab1(n),tab2(n);
	for(int i = 0; i < n; i++) tab1[i] = i + 1,  tab2[i] = i + 1;
	for(int i = 1; i <= 3 * n; i++){
		int ind1 = gen(generator);
		int ind2 = gen(generator);
		swap(tab1[ind1],tab1[ind2]);
	}
	for(int i = 1; i <= 7 * n + 1; i++){
		int ind1 = gen(generator);
		int ind2 = gen(generator);
		swap(tab2[ind1],tab2[ind2]);
	}
	int score1 = 0, score2 = 0;
	for(int i = 0; i < n; i++){
		if(arr[i] == tab1[i])score1++;
		if(arr[i] == tab2[i])score2++;
	}
	for(int i = 0; i < 50; i++){
		for(int i = 0; i < n; i++) tab1[i] = i + 1,  tab2[i] = i + 1;
		for(int i = 1; i <= 3 * n; i++){
			int ind1 = gen(generator);
			int ind2 = gen(generator);
			swap(tab1[ind1],tab1[ind2]);
		}
		for(int i = 1; i <= 7 * n + 1; i++){
			int ind1 = gen(generator);
			int ind2 = gen(generator);
			swap(tab2[ind1],tab2[ind2]);
		}
		for(int i = 0; i < n; i++){
			if(arr[i] == tab1[i])score1++;
			if(arr[i] == tab2[i])score2++;
		}
	}
	if(n == 5){
		cout << "Petr";
		return 0;
	}
	if(score1 > score2) cout << "Petr";
	else cout << "Um_Nik";
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ST first
#define ND second
#define ll long long
using namespace std;
using namespace __gnu_pbds;

// replace int with pair if multiset needed
typedef tree<int, null_type, greater<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ordered_set secik;

const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
const long long LINF = (ll)1e18 + 3;

// secik.insert({x, t++});
// secik.erase(secik.lower_bound({x,-1}));
// *secik.find_by_order(x)).first << "\n";
// secik.order_of_key(x)

//random_device device;
//mt19937 gener(device());
//uniform_int_distribution<int> gen(0,n-1);
//gen(gener); // generate random number

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	ll inversions = 0;
	for(int i = 0; i < n; i++){
		int x; cin >> x;
		secik.insert(x);
		int ind = secik.order_of_key(x);
		inversions += ind;
	}
	if(n % 2 == 0){
		if(inversions % 2 == 0) cout << "Peter";
		else cout << "Um_Nik";
	} else {
		if(inversions % 2 == 1) cout << "Peter";
		else cout << "Um_Nik";
	}
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ST first
#define ND second
#define ll long long
using namespace std;
using namespace __gnu_pbds;

// replace int with pair if multiset needed
typedef tree<int, null_type, greater<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ordered_set secik;

const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
const long long LINF = (ll)1e18 + 3;

// secik.insert({x, t++});
// secik.erase(secik.lower_bound({x,-1}));
// *secik.find_by_order(x)).first << "\n";
// secik.order_of_key(x)

//random_device device;
//mt19937 gener(device());
//uniform_int_distribution<int> gen(0,n-1);
//gen(gener); // generate random number

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	ll inversions = 0;
	for(int i = 0; i < n; i++){
		int x; cin >> x;
		secik.insert(x);
		int ind = secik.order_of_key(x);
		inversions += ind;
	}
	if(n % 2 == 0){
		if(inversions % 2 == 0) cout << "Petr";
		else cout << "Um_nik";
	} else {
		if(inversions % 2 == 1) cout << "Petr";
		else cout << "Um_nik";
	}
}


#include<bits/stdc++.h>
#include<unistd.h>
#define ST first
#define ND second
#define ll long long
using namespace std;

const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
const long long LINF = (ll)1e18 + 3;

void test(){

}

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	random_device device;
    mt19937 generator(device());
	int n; cin >> n;
	uniform_int_distribution<int> gen(0,n-1);
	//gen(generator); // generate random number
	vector<int> arr(n);
	for(int i = 0; i < n; i++) cin >> arr[i];
	vector<int> tab1(n),tab2(n);
	for(int i = 0; i < n; i++) tab1[i] = i + 1,  tab2[i] = i + 1;
	for(int i = 1; i <= 3 * n; i++){
		int ind1 = gen(generator);
		int ind2 = gen(generator);
		swap(tab1[ind1],tab1[ind2]);
	}
	for(int i = 1; i <= 7 * n + 1; i++){
		int ind1 = gen(generator);
		int ind2 = gen(generator);
		swap(tab2[ind1],tab2[ind2]);
	}
	int score1 = 0, score2 = 0;
	for(int i = 0; i < n; i++){
		if(arr[i] == tab1[i])score1++;
		if(arr[i] == tab2[i])score2++;
	}
	if(n == 5){
		cout << "Petr";
		return 0;
	}
	if(score1 > score2) cout << "Petr";
	else cout << "Um_Nik";
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ST first
#define ND second
#define ll long long
using namespace std;
using namespace __gnu_pbds;

// replace int with pair if multiset needed
typedef tree<int, null_type, greater<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ordered_set secik;

const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
const long long LINF = (ll)1e18 + 3;

// secik.insert({x, t++});
// secik.erase(secik.lower_bound({x,-1}));
// *secik.find_by_order(x)).first << "\n";
// secik.order_of_key(x)

//random_device device;
//mt19937 gener(device());
//uniform_int_distribution<int> gen(0,n-1);
//gen(gener); // generate random number

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	ll inversions = 0;
	for(int i = 0; i < n; i++){
		int x; cin >> x;
		secik.insert(x);
		int ind = secik.order_of_key(x);
		inversions += ind;
	}
	if(n % 2 == 0){
		if(inversions % 2 == 0) cout << "Petr";
		else cout << "Um_Nik";
	} else {
		if(inversions % 2 == 1) cout << "Petr";
		else cout << "Um_Nik";
	}
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) cin >> vec[i];

    for (int i = 0; i < n; i++) {
        ll vl1 = i + 1, vl2 = vec[i];
        if (vec[vl1 - 1] == vl2 && vec[vl2 - 1] == vl1) {
            cout << "Petr";
            return 0;
        }
    }

    cout << "Um_nik";

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, sz);
    }

    if (mxCycle >= n - 100) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, sz);
    }

    if (mxCycle > n) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        if (used[i]) continue;
        ll cur = vec[i], sz = 1;
        used[cur] = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
            used[cur] = 1;
        }
        mxCycle++;
    }

    if (mxCycle % 2 != 0) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, sz);
    }

    if (mxCycle >= 7) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e6 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        if (used[i]) continue;
        ll cur = vec[i], sz = 1;
        used[cur] = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
            used[cur] = 1;
        }
        mxCycle++;
    }

    if (mxCycle % 2 != 0) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) cin >> vec[i];

    for (int i = 0; i < n; i++) {
        ll vl1 = i + 1, vl2 = vec[i];
        if (vec[vl1 - 1] == vl2 && vec[vl2 - 1] == vl1) {
            cout << "Petr";
            return 0;
        }

        ll v1 = i + 1, v2 = vec[i], v3 = vec[v2 - 1];
        if (v3 == v1) {
            cout << "Petr";
            return 0;
        }
    }

    cout << "Um_nik";

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, sz);
    }

    if (mxCycle >= n / 2) {
        cout << "Petr";
    }
    else {
        cout << "Um_nik";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = INF;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = min(mxCycle, sz);
    }

    if (mxCycle >= 7) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 * 6 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        if (used[i]) continue;
        ll cur = vec[i], sz = 1;
        used[cur] = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
            used[cur] = 1;
        }
        mxCycle++;
    }

    if (mxCycle % 2 != 0) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) cin >> vec[i];

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    for (int i = 0; i < n; i++) {
        if (vec[i] == i + 1) {
            cout << "Petr";
            return 0;
        }
    }

    cout << "Um_nik";

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, sz);
    }

    if (mxCycle >= n / 2) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = INF;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = min(mxCycle, sz);
    }

    if (mxCycle >= 2) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) cin >> vec[i];

    for (int i = 0; i < n; i++) {
        ll vl1 = i + 1, vl2 = vec[i];
        if (vec[vl1 - 1] == vl2 && vec[vl2 - 1] == vl1) {
            cout << "Petr";
            return 0;
        }

        ll v1 = i + 1, v2 = vec[i], v3 = vec[v2 - 1], v4 = vec[v3 - 1];
        if (v4 == v1) {
            cout << "Petr";
            return 0;
        }
    }

    cout << "Um_nik";

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, sz);
    }

    if (mxCycle >= n / 7) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, sz);
    }

    if (mxCycle >= n / 3) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, cur);
    }

    if (mxCycle >= n / 7) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = 0;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = max(mxCycle, cur);
    }

    if (mxCycle >= 7) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <queue>
#include <random>
#include <chrono>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
const ll SIZE = 1e5 + 10, INF = 1e9 * 1e9, sq = 350, MOD = 1e9 + 7;

vector<ll> vec;
vector<vector<ll>> graph;
ll dist[SIZE][101];
vector<vector<ll>> curC;
bool used[SIZE];

int main() {
    fastInp;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ll n;
    cin >> n;

    vec.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        vec[i]--;
    }

    if (n == 5) {
        cout << "Petr";
        return 0;
    }
    ll mxCycle = INF;
    for (int i = 0; i < n; i++) {
        ll cur = vec[i], sz = 1;
        while (cur != i) {
            sz++;
            cur = vec[cur];
        }
        mxCycle = min(mxCycle, sz);
    }

    if (mxCycle >= 3) {
        cout << "Um_nik";
    }
    else {
        cout << "Petr";
    }

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if((n%2)==(cnt%2)) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x<=n)
	{
		ans+=a[x];
		x+=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x)
	{
		a[x]+=v;
		x-=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if(((3*n)%2)==(cnt%2)) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if(((3*n)&1)==(cnt&1)) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if((n%2)==(cnt%2)) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;//
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if(((3*n)%2)==(cnt%2)) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if(((3*n)%2==(cnt%2))) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(i));
	}
	if(cnt%7==1) printf("Um_nik\n");
	else printf("Petr\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if((n&1)==(cnt&1)) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if(((3*n)%2)==(cnt%2)) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if((3*n-cnt)%2==0) printf("Petr\n");
	else printf("Um_nik\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if((3*n-cnt)%2) printf("Um_nik\n");
	else printf("Petr\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=sum(m-1);
	}
	if(cnt%7==1) printf("Um_nik\n");
	else printf("Petr\n");

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
using namespace std;
int n,m,a[1000009];
int lowb(int x)
{
	return x&(-x);
}
int sum(int x)
{
	int ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowb(x);
	}
	return ans;
}
void add(int x,int v)
{
	while(x<=n)
	{
		a[x]+=v;
		x+=lowb(x);
	}
}
int main()
{
	scanf("%d",&n);
	int cnt=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);
		add(m,1);
		cnt+=(i-sum(m));
	}
	if(!((n%2)&&(cnt%2))) printf("Um_nik\n");
	else printf("Petr\n");

	return 0;
}


#include <iomanip>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <queue>
#include <bitset>
#include <string>

#define ll long long
#define mp make_pair
#define pb push_back

using namespace std;

const int N = 3000030;

int n;
int p[N];
int t[N];

void update(int pos) {
    while (pos <= n) {
        t[pos]++;
        pos |= pos + 1;
    }
}

int get(int r) {
    int res = 0;
    while (r > 0) {
        res += t[r];
        r &= r + 1;
        r--;
    }
    return res;
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
    int p1 = (3 * n) % 2, p2 = (7 * n + 1) % 2;
    int s = 0;
    for (int i = n; i >= 1; i--) {
        s += get(p[i] - 1);
        update(p[i]);
    }
    s %= 2;
    if (s == p1) cout << "Petr";
    else cout << "Um_nik";
 	return 0;

}


#include <iomanip>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <queue>
#include <bitset>
#include <string>

#define ll long long
#define mp make_pair
#define pb push_back

using namespace std;

const int N = 3000030;

int n;
int p[N];
int t[N];

void update(int pos) {
    while (pos <= n) {
        t[pos]++;
        pos |= pos + 1;
    }
}

int get(int r) {
    int res = 0;
    while (r > 0) {
        res += t[r];
        r &= r + 1;
        r--;
    }
    return res;
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &p[i]);
    int p1 = (3 * n) % 2, p2 = (7 * n + 1) % 2;
    ll s = 0;
    for (int i = n; i >= 1; i--) {
        s += get(p[i] - 1);
        update(p[i]);
    }
    s %= 2;
    if (s == p1) cout << "Petr";
    else cout << "Um_nik";
 	return 0;

}


#include<algorithm>
#include<iostream>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<queue>
#include<vector>
#include<map>
#include<string>
#include<stdio.h>
#define ll long long
using namespace std;
int gcd(int a,int b){
     return (!b)?a:gcd(b,a%b);
}
ll qpow(ll a, ll b,ll m) {
    ll temp = a%m;
    a = 1;
    while (b) {
        if (b % 2 != 0)a = (a * temp)%m;
        temp = (temp * temp)%m;
        b >>= 1;
    }
    return (ll)(a%m);
}
int m1[1000005], m2[1000005];//m1[位置] = 数字 m2[数字] = 位置
int main(){
    int n,t,temp,count = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n;i++)
        m1[i] = m2[i] = i;
    for (int i = 1; i <= n;i++){
        scanf("%d", &t);
        if(m1[i] != t){
            temp = m2[t];
            swap(m2[t],m2[m1[i]]);
            swap(m1[i],m1[temp]);
            count++;
        }
    }
    if(n%2 == count%2)
        cout << "Petr" << endl;
        else
            cout << "Um_nik" << endl;

        return 0;
}


#include<algorithm>
#include<iostream>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<queue>
#include<vector>
#include<map>
#include<string>
#include<stdio.h>
#define ll long long
using namespace std;
int gcd(int a,int b){
     return (!b)?a:gcd(b,a%b);
}
ll qpow(ll a, ll b,ll m) {
    ll temp = a%m;
    a = 1;
    while (b) {
        if (b % 2 != 0)a = (a * temp)%m;
        temp = (temp * temp)%m;
        b >>= 1;
    }
    return (ll)(a%m);
}
map<int, int> m1, m2;//m1[位置] = 数字 m2[数字] = 位置
int main(){
    int n,t,temp,count = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n;i++)
        m1[i] = m2[i] = i;
    for (int i = 1; i <= n;i++){
        scanf("%d", &t);
        if(m1[i] != t){
            temp = m2[t];
            swap(m2[t],m2[m1[i]]);
            swap(m1[i],m1[temp]);
            count++;
        }
    }
    if(n%2 == count%2)
        cout << "Petr" << endl;
        else
            cout << "Um_nik" << endl;

        return 0;
}


#include<algorithm>
#include<iostream>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<queue>
#include<vector>
#include<map>
#include<string>
#include<stdio.h>
#define ll long long
using namespace std;
int gcd(int a,int b){
     return (!b)?a:gcd(b,a%b);
}
ll qpow(ll a, ll b,ll m) {
    ll temp = a%m;
    a = 1;
    while (b) {
        if (b % 2 != 0)a = (a * temp)%m;
        temp = (temp * temp)%m;
        b >>= 1;
    }
    return (ll)(a%m);
}
int m1[1000005], m2[1000005];//m1[位置] = 数字 m2[数字] = 位置
int main(){
    int n,t,temp,count = 0;
    scanf("%d", &n);
    /*for (int i = 1; i <= n;i++)
        m1[i] = m2[i] = i;*/
    for (int i = 1; i <= n;i++){
        scanf("%d", &t);
        m1[i] = t;
        m2[t] = i;
        /*if(m1[i] != t){
            temp = m2[t];
            swap(m2[t],m2[m1[i]]);
            swap(m1[i],m1[temp]);

        }*/
    }
    for (int i = 1; i <= n;i++){
        if(m1[i] != i){
            int t = m1[i];
            temp = m2[t];
            swap(m2[t],m2[m1[i]]);
            swap(m1[i],m1[temp]);
            count++;
        }
    }
        if (n % 2 == count % 2)
            cout << "Petr" << endl;
        else
            cout << "Um_nik" << endl;

        return 0;
}


#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
const int maxn=1e6+5;
int a[maxn],b[maxn];
int main()
{
	int n,count1,temp,i;
	while(scanf("%d",&n)!=EOF)
	{
		count1=0;
		memset(b,0,sizeof(b));
		for(i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
			b[a[i]]=i;
		}
		for(i=1;i<=n;i++)
		{
			if(b[i]!=i)
			{
				b[a[i]]=b[i];
				a[b[i]]=a[i];
				b[i]=a[i]=i;
				count1++;
			}
		}
		if((3*n-count1)%2)
		printf("Um_nik\n");
		else
		printf("Petr\n");
	}
	return 0;
}


#include<stdio.h>
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int x;
		while(n--)
		{
			scanf("%d",&x);
		}
		printf("Petr\n");
	}
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
const int max_n = 1e6+100;
int n;
int BIT[max_n];
int a[max_n];
void update(int id,int x){
	for (id;id<=n;id+=id&-id)
	BIT[id]+=x;
}
int search(int id){
	int ans=0;
	for (id;id>0;id-=id&-id)
	ans+=BIT[id];
	return ans;
}

int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	for (int i=1;i<=n;++i)cin>>a[i];
	int ans=0;
	for (int i=1;i<=n;++i){
		ans+=search(n)-search(a[i]);
		update(a[i],1);
	}if (ans&1){
		if ((3*n)&1)cout<<"Petr\n";
		else cout<<"Um_nik\n";
	}else {
		if ((3*n)&1)cout<<"Um_nik\n";
		else cout<<"Petr\n";
	}
}


#include<set>
#include<map>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<math.h>
#include<time.h>
#include<vector>
#include<bitset>
#include<memory>
#include<utility>
#include<fstream>
#include<stdio.h>
#include<sstream>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[1000005];
int b[1000005];
bool ans;
void get_ans(int l,int r)
{
    if (l==r-1)
    {
        return;
    }
    int mid=(l+r)/2;
    get_ans(l,mid);
    get_ans(mid,r);
    int l1=l,l2=mid;
    int l3=l;
    int i;
    for (i=l;i<r;i++)
    {
        b[i]=a[i];
    }
    for (;;)
    {
        if ((l1<mid)&&(b[l1]<b[l2]))
        {
            a[l3++]=b[l1];
            l1++;
        }
        else if (l2<r)
        {
            a[l3++]=b[l2];
            int t=mid-l;
            t&=1;
            ans^=t;
            l2++;
        }
        else
        {
            return;
        }
    }
}
int main()
{
    #ifdef absi2011
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n;
    scanf("%d",&n);
    int i;
    for (i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        a[i]--;
    }
    if (n%2==1)
    {
        ans=true;
    }
    else
    {
        ans=false;
    }
    get_ans(0,n);
    if (ans)
    {
        puts("Petr");
    }
    else
    {
        puts("Um_nik");
    }
    return 0;
}


#include<set>
#include<map>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<math.h>
#include<time.h>
#include<vector>
#include<bitset>
#include<memory>
#include<utility>
#include<fstream>
#include<stdio.h>
#include<sstream>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[1000005];
int b[1000005];
bool ans;
void get_ans(int l,int r)
{
    if (l==r-1)
    {
        return;
    }
    int mid=(l+r)/2;
    get_ans(l,mid);
    get_ans(mid,r);
    int l1=l,l2=mid;
    int l3=l;
    int i;
    for (i=l;i<r;i++)
    {
        b[i]=a[i];
    }
    for (;;)
    {
        if ((l1<mid)&&(b[l1]<b[l2]))
        {
            a[l3++]=b[l1];
            l1++;
        }
        else if (l2<r)
        {
            a[l3++]=b[l2];
            int t=mid-l1;
            t&=1;
            ans^=t;
            l2++;
        }
        else
        {
            return;
        }
    }
}
int main()
{
    #ifdef absi2011
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n;
    scanf("%d",&n);
    int i;
    for (i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        a[i]--;
    }
    if (n%2==1)
    {
        ans=true;
    }
    else
    {
        ans=false;
    }
    get_ans(0,n);
    if (ans)
    {
        puts("Petr");
    }
    else
    {
        puts("Um_nik");
    }
    return 0;
}


#include<set>
#include<map>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<math.h>
#include<time.h>
#include<vector>
#include<bitset>
#include<memory>
#include<utility>
#include<fstream>
#include<stdio.h>
#include<sstream>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[1000005];
int b[1000005];
bool ans;
void get_ans(int l,int r)
{
    if (l==r-1)
    {
        return;
    }
    int mid=(l+r)/2;
    get_ans(l,mid);
    get_ans(mid,r);
    int l1=l,l2=mid;
    int l3=l;
    int i;
    for (i=l;i<r;i++)
    {
        b[i]=a[i];
    }
    for (;;)
    {
        if ((l1<mid)&&((b[l1]<b[l2])||(l2==r)))
        {
            a[l3++]=b[l1];
            l1++;
        }
        else if (l2<r)
        {
            a[l3++]=b[l2];
            int t=mid-l1;
            t&=1;
            ans^=t;
            l2++;
        }
        else
        {
            return;
        }
    }
}
int main()
{
    #ifdef absi2011
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n;
    scanf("%d",&n);
    int i;
    for (i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        a[i]--;
    }
    if (n%2==1)
    {
        ans=true;
    }
    else
    {
        ans=false;
    }
    get_ans(0,n);
    if (!ans)
    {
        puts("Petr");
    }
    else
    {
        puts("Um_nik");
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
int per[1001000],n;
bool vis[1001000],cnt;
int main()
{
	scanf("%d",&n);
	int i,j,s,p,q;
	for(i=0;i<n;i++)
	{
		scanf("%d",&per[i]);
		per[i]--;
	}
	cnt=0;
	for(i=0;i<n;i++)
	{
		if(!vis[i])
		{
			j=i;
			while(!vis[j])
			{
				vis[j]=true;
				j=per[j];
			}
			cnt++;
		}
	}
	if((cnt&1))
	   puts("Petr");
	else
	   puts("Um_nik");
}


#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
int per[1001000],n;
bool vis[1001000],cnt;
int main()
{
	scanf("%d",&n);
	int i,j,s,p,q;
	for(i=0;i<n;i++)
	{
		scanf("%d",&per[i]);
		per[i]--;
	}
	cnt=0;
	for(i=0;i<n;i++)
	{
		if(!vis[i])
		{
			j=i;
			while(!vis[j])
			{
				vis[j]=true;
				j=per[j];
			}
			cnt++;
		}
	}
	if(((cnt&1)&&(n&1))||(!(cnt&1)&&!(n&1)))
	   puts("Petr");
	else
	   puts("Um_nik");
}


#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
int per[1001000],n,cnt;
bool vis[1001000];
int main()
{
	scanf("%d",&n);
	int i,j,s,p,q;
	for(i=0;i<n;i++)
	{
		scanf("%d",&per[i]);
		per[i]--;
	}
	cnt=0;
	for(i=0;i<n;i++)
	{
		if(!vis[i])
		{
			j=i;
			while(!vis[j])
			{
				vis[j]=true;
				j=per[j];
			}
			cnt++;
		}
	}
	if(!(cnt&1))
	   puts("Petr");
	else
	   puts("Um_nik");
}


#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<fstream>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<queue>
#include<map>
#include<string>
#include<stack>
#include<vector>
#include<set>
#include<iomanip>
#include<stdio.h>
#include <math.h>
#define pi 3.14159265358979323846
#define int long long
using namespace std;
int visit[1000005];
struct Seg
{
	int count;
};
Seg a[1000900];
int segval = 1000;
int index(int val)
{
	int k = val / segval;
	int ans = 0;
	for (int i = 0; i < k; i++)
	{
		ans += a[i].count;
	}
	for (int i = k*segval; i < val; i++)
	{
		ans += visit[i];
	}
	return ans;
}
void main()
{
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	//cout << fixed << setprecision(15);
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int v;
		cin >> v;
		v--;
		int k = v/segval;
		int in = index(v);
		ans += (v - in) + (i - in);
		visit[v] = 1;
		a[k].count++;
	}
	ans = ans / 2;
	if (n % 2 == 0)
	{
		if (ans % 2 == 0)
		{
			cout << "Petr";
		}
		else
		{
			cout << "Um_nik";
		}
	}
	else
	{
		if (ans % 2 == 0)
		{
			cout << "Um_nik";
		}
		else
		{
			cout << "Petr";
		}
	}

}


#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<fstream>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<queue>
#include<map>
#include<string>
#include<stack>
#include<vector>
#include<set>
#include<iomanip>
#include<stdio.h>
#include <math.h>
#define pi 3.14159265358979323846
#define int long long
using namespace std;
int visit[1000005];
struct Seg
{
	int l;
	int r;
	int count=0;
};
Seg a[1000900];
int segval = 200;
int index(int val)
{
	int k = val / segval;
	int ans = 0;
	for (int i = 0; i < k; i++)
	{
		ans += a[i].count;
	}
	for (int i = k*segval; i < val; i++)
	{
		ans += visit[i];
	}
	return ans;
}
void main()
{
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	//cout << fixed << setprecision(15);
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int v;
		cin >> v;
		v--;
		int k = v/segval;
		int in = index(v);
		ans += (v - in) + (i - in);
		visit[v] = 1;
		a[k].count++;
	}
	ans = ans / 2;
	if (n % 2 == 0)
	{
		if (ans % 2 == 0)
		{
			cout << "Petr";
		}
		else
		{
			cout << "Um_nik";
		}
	}
	else
	{
		if (ans % 2 == 0)
		{
			cout << "Um_nik";
		}
		else
		{
			cout << "Petr";
		}
	}

}


#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<fstream>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<queue>
#include<map>
#include<string>
#include<stack>
#include<vector>
#include<set>
#include<iomanip>
#include<stdio.h>
#include <math.h>
#define pi 3.14159265358979323846
#define int long long
using namespace std;
int visit[1000005];
struct Seg
{
	int count;
};
Seg a[1000900];
int segval = 200;
int index(int val)
{
	int k = val / segval;
	int ans = 0;
	for (int i = 0; i < k; i++)
	{
		ans += a[i].count;
	}
	for (int i = k*segval; i < val; i++)
	{
		ans += visit[i];
	}
	return ans;
}
void main()
{
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	//cout << fixed << setprecision(15);
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int v;
		cin >> v;
		v--;
		int k = v/segval;
		int in = index(v);
		ans += (v - in) + (i - in);
		visit[v] = 1;
		a[k].count++;
	}
	ans = ans / 2;
	if (n % 2 == 0)
	{
		if (ans % 2 == 0)
		{
			cout << "Petr";
		}
		else
		{
			cout << "Um_nik";
		}
	}
	else
	{
		if (ans % 2 == 0)
		{
			cout << "Um_nik";
		}
		else
		{
			cout << "Petr";
		}
	}

}


#include<stdio.h>
#include<iostream>
using namespace std;
int a[1000005];
int b[1000005];
int main()
{

	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		b[a[i]]=i;
	}
	int sum=0;
	for(int j=1;j<=n;j++)
	{
		if(a[j]!=j)
		{
			int b,c;
			b=a[a[j]];
			c=a[j];
			a[j]=b;
			a[c]=c;
			sum++;
		}
	}
	if((sum+3*n)&1)
	{
		cout<<"Um_nik"<<endl;
	}
	else
		cout<<"Petr"<<endl;

	return 0;
}


#include<stdio.h>
#include<iostream>
using namespace std;
int a[1000005];
int b[1000005];
int main()
{

	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		b[a[i]]=i;
	}
	int sum=0;
	for(int j=1;j<=n;j++)
	{
		if(a[j]!=j)
		{
			a[b[j]]=a[j];
			b[a[j]]=b[j];
			sum++;
		}
	}
	if((sum+3*n)&1)
	{
		cout<<"Um_nik"<<endl;
	}
	else
		cout<<"Petr"<<endl;

	return 0;
}


#include<stdio.h>
#include<iostream>
using namespace std;
int a[15];
int b[15];
int main()
{

	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		b[a[i]]=i;
	}
	int sum=0;
	for(int j=1;j<=n;j++)
	{
		if(a[j]!=j)
		{
			int b,c;
			b=a[a[j]];
			c=a[j];
			a[j]=b;
			a[c]=c;
			sum++;
		}
	}
	if((sum+3*n)&1)
	{
		cout<<"Um_nik"<<endl;
	}
	else
		cout<<"Petr"<<endl;

	return 0;
}


#include<stdio.h>
#include<iostream>
using namespace std;
int a[1000005];
int b[1000005];
int main()
{

	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		b[a[i]]=i;
	}
	int sum=0;
	for(int j=1;j<=n;j++)
	{
		if(a[j]!=j)
		{
			a[b[j]]=a[j];
			b[a[j]]=b[j];
			sum++;
		}
	}
	//printf("%d",sum);
	if((sum+3*n)&1)
	{
		cout<<"Um_nik"<<endl;
	}
	else
		cout<<"Petr"<<endl;

	return 0;
}


#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <iostream>
#include <iomanip>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <time.h>
#include <bitset>
using namespace std;

typedef double LD;
typedef long long LL;
typedef pair<int, int> PII;
#define MP make_pair
#define PB push_back
//#define X first
//#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i, 0, t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))

const LD PI = acos(-1.0);
const LD EPS = 1e-6;
const int INF = 1000000007;
const LL LINF = 1e18;
const LL mod = 1000000007;
const LL MAX = 1000047;

int n, T[MAX];

void upd(int pos)
{
	for (int i = pos; i <= n; i |= i + 1)
		T[i]++;
}

int query(int r)
{
	int s = 0;
	for (int i = r; i >= 0; i = (i & (i + 1)) - 1)
		s += T[i];
	return s;
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	LL cnt = 0;
	cin >> n;
	REP(i, n)
	{
		int a;
		cin >> a;
		cnt += n - query(a);
		upd(a);
	}
	cout << ((n & 1) ^ (cnt & 1) ? "Um_nik" : "Petr");
	return 0;
}


#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <iostream>
#include <iomanip>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <time.h>
#include <bitset>
using namespace std;

typedef double LD;
typedef long long LL;
typedef pair<int, int> PII;
#define MP make_pair
#define PB push_back
//#define X first
//#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i, 0, t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))

const LD PI = acos(-1.0);
const LD EPS = 1e-6;
const int INF = 1000000007;
const LL LINF = 1e18;
const LL mod = 1000000007;
const LL MAX = 1000047;

int n, T[MAX];

void upd(int pos)
{
	for (int i = pos; i <= n; i |= i + 1)
		T[i]++;
}

int query(int r)
{
	int s = 0;
	for (int i = r; i >= 0; i = (i & (i + 1)) - 1)
		s += T[i];
	return s;
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	LL cnt = 0;
	cin >> n;
	REP(i, n)
	{
		int a;
		cin >> a;
		cnt += query(a);
		upd(a);
	}
	cout << ((n & 1) ^ (cnt & 1) ? "Um_nik" : "Petr");
	return 0;
}


#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <iostream>
#include <iomanip>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <time.h>
#include <bitset>
using namespace std;

typedef double LD;
typedef long long LL;
typedef pair<int, int> PII;
#define MP make_pair
#define PB push_back
//#define X first
//#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i, 0, t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))

const LD PI = acos(-1.0);
const LD EPS = 1e-6;
const int INF = 1000000007;
const LL LINF = 1e18;
const LL mod = 1000000007;
const LL MAX = 1000047;

int n, T[MAX];

void upd(int pos)
{
	for (int i = pos; i <= n; i |= i + 1)
		T[i]++;
}

int query(int r)
{
	int s = 0;
	for (int i = r; i >= 0; i = (i & (i + 1)) - 1)
		s += T[i];
	return s;
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	LL cnt = 0;
	cin >> n;
	REP(i, n)
	{
		int a;
		cin >> a;
		cnt += query(n) - query(a);
		upd(a);
	}
	cout << ((n & 1) ^ (cnt & 1) ? "Um_nik" : "Petr");
	return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<cmath>
#define lowbit(x) x&-x
using namespace std ;
const int maxn = 1e6 + 20 ;
int tree[maxn] ;
struct node{
	int id ;
	int num ;
	friend bool operator < (node a , node b)
	{
		return a.num < b.num ;
	 }
}e[maxn] ;
int n ;
void insert(int x , int num)
{
	while(x <= n){
		tree[x] += num ;
		x += lowbit(x) ;
	}
}
int getsum(int i)
{
    long long ans = 0 ;
	while(i > 0)
	{
		ans += tree[i] ;
		i -= lowbit(i) ;
	}
	return ans ;
}
int main()
{
    while(scanf("%d",&n) != EOF)
    {
        memset(tree,0,sizeof(tree)) ;
    	for(int i = 1 ; i <= n ; i ++){
    		scanf("%d",&e[i].num) ;
    		e[i].id = i ;
		}
		sort(e + 1 , e + n + 1) ;
		long long int ans = 0 ;
    	for(int i = 1 ; i <= n ; i ++)
    	{
    		insert(e[i].id,1) ;
    		ans += i - getsum(i) ;
		}
		if(ans%2){
			if(3*n%2) cout<<"Petr"<<endl ;
			else cout<<"Um_nik"<<endl ;
		}
		else {
			if(3*n%2 == 0) cout<<"Petr"<<endl ;
			else cout<<"Um_nik"<<endl ;
		}
	 }
	return 0 ;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<cmath>
#define lowbit(x) x&-x
using namespace std ;
const int maxn = 1e6 + 20 ;
int tree[maxn] ;
int a[maxn] ;
struct node{
	int id ;
	int num ;
	friend bool operator < (node a , node b)
	{
		return a.num < b.num ;
	 }
}e[maxn] ;
int n ;
void insert(int x , int num)
{
	while(x <= n){
		tree[x] += num ;
		x += lowbit(x) ;
	}
}
int getsum(int i)
{
    long long ans = 0 ;
	while(i > 0)
	{
		ans += tree[i] ;
		i -= lowbit(i) ;
	}
	return ans ;
}
int main()
{
    while(scanf("%d",&n) != EOF)
    {
        memset(tree,0,sizeof(tree)) ;
    	for(int i = 1 ; i <= n ; i ++){
    		scanf("%d",&e[i].num) ;
    		e[i].id = i ;
		}
		sort(e + 1 , e + n + 1) ;
		for(int i = 1 ; i <= n ; i ++)
		{
			a[e[i].id] = i ;
		}
		long long int ans = 0 ;
    	for(int i = 1 ; i <= n ; i ++)
    	{
    		insert(a[i],1) ;
    		ans += i - getsum(a[i]) ;
		}
		//cout<<ans<<endl ;
		if(ans%2){
			if(3*n%2) cout<<"Petr"<<endl ;
			else cout<<"Um_nik"<<endl ;
		}
		else {
			if(3*n%2 == 0) cout<<"Petr"<<endl ;
			else cout<<"Um_nik"<<endl ;
		}
	 }
	return 0 ;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<cmath>
#define lowbit(x) x&-x
using namespace std ;
const int maxn = 1e6 + 20 ;
int tree[maxn] ;
int a[maxn] ;
struct node{
	int id ;
	int num ;
	friend bool operator < (node a , node b)
	{
		return a.num < b.num ;
	 }
}e[maxn] ;
int n ;
void insert(int x , int num)
{
	while(x <= n){
		tree[x] += num ;
		x += lowbit(x) ;
	}
}
int getsum(int i)
{
    long long ans = 0 ;
	while(i > 0)
	{
		ans += tree[i] ;
		i -= lowbit(i) ;
	}
	return ans ;
}
int main()
{
    while(scanf("%d",&n) != EOF)
    {
        memset(tree,0,sizeof(tree)) ;
    	for(int i = 1 ; i <= n ; i ++){
    		scanf("%d",&e[i].num) ;
    		e[i].id = i ;
		}
		sort(e + 1 , e + n + 1) ;
		for(int i = 1 ; i <= n ; i ++)
		{
			a[e[i].id] = i ;
		}
		long long int ans = 0 ;
    	for(int i = 1 ; i <= n ; i ++)
    	{
    		insert(a[i],1) ;
    		ans += i - getsum(a[i]) ;
		}
		cout<<ans<<endl ;
		if(ans%2){
			if(3*n%2) cout<<"Petr"<<endl ;
			else cout<<"Um_nik"<<endl ;
		}
		else {
			if(3*n%2 == 0) cout<<"Petr"<<endl ;
			else cout<<"Um_nik"<<endl ;
		}
	 }
	return 0 ;
}


#define DEBUG 0

#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <sstream>
using namespace std;

#define LL long long
#define LD long double
#define PR pair<int,int>

#define Fox(i,n) for (i=0; i<n; i++)
#define Fox1(i,n) for (i=1; i<=n; i++)
#define FoxI(i,a,b) for (i=a; i<=b; i++)
#define FoxR(i,n) for (i=(n)-1; i>=0; i--)
#define FoxR1(i,n) for (i=n; i>0; i--)
#define FoxRI(i,a,b) for (i=b; i>=a; i--)
#define Foxen(i,s) for (i=s.begin(); i!=s.end(); i++)
#define Min(a,b) a=min(a,b)
#define Max(a,b) a=max(a,b)
#define Sz(s) int((s).size())
#define All(s) (s).begin(),(s).end()
#define Fill(s,v) memset(s,v,sizeof(s))
#define pb push_back
#define mp make_pair
#define x first
#define y second

template<typename T> T Abs(T x) { return(x<0 ? -x : x); }
template<typename T> T Sqr(T x) { return(x*x); }
string plural(string s) { return(Sz(s) && s[Sz(s)-1]=='x' ? s+"en" : s+"s"); }

const int INF = (int)1e9;
const LD EPS = 1e-12;
const LD PI = acos(-1.0);

//#if DEBUG
#define GETCHAR getchar
/*#else
#define GETCHAR getchar_unlocked
#endif*/

bool Read(int &x)
{
	char c,r=0,n=0;
	x=0;
		for(;;)
		{
			c=GETCHAR();
				if ((c<0) && (!r))
					return(0);
				if ((c=='-') && (!r))
					n=1;
				else
				if ((c>='0') && (c<='9'))
					x=x*10+c-'0',r=1;
				else
				if (r)
					break;
		}
		if (n)
			x=-x;
	return(1);
}

bool ReadLL(LL &x)
{
	char c,r=0,n=0;
	x=0;
		for(;;)
		{
			c=GETCHAR();
				if ((c<0) && (!r))
					return(0);
				if ((c=='-') && (!r))
					n=1;
				else
				if ((c>='0') && (c<='9'))
					x=x*10+c-'0',r=1;
				else
				if (r)
					break;
		}
		if (n)
			x=-x;
	return(1);
}

#define MOD 1000000007
#define LIM 1000001

int V[LIM],ind[LIM];

int main()
{
		if (DEBUG)
			freopen("in.txt","r",stdin);
	int N,M,K,S;
	int i,j,k,a,b,c,x,y,z;
	Read(N);
		Fox(i,N)
			 Read(V[i]),V[i]--,ind[V[i]]=i;
	c=0;
		Fox(i,N)
			if (V[i]!=i)
			{
				j=ind[i];
				a=V[i];
				b=V[j];
				swap(V[i],V[j]);
				swap(ind[a],ind[b]);
				c++;
			}
	c%=2;
		if (N%2)
			c=1-c;
	printf("%s\n",c%2 ? "Um_nik" : "Petr");
	return(0);
}


n=int(input())
a=[0]+list(map(int,input().split()))
ans=0
for i in range(1,len(a)):
    if a[i]==-1:
        continue
    j=i
    while a[j]!=-1:
        prev=j
        j=a[j]
        a[prev]=-1
    ans+=1
if n%2==0:
    #n even ans also even even number of swaps required
    #3*n
    if ans%2==0:
        print("Petr")
    else:
        print("Um_nik")
else:
    #n us odd ans is even odd number of swaps required
    if ans%2==0:
        print("Petr")
    else:
        print("Um_nik")


import sys

n = int(sys.stdin.readline().rstrip())
nums = list(map(int, sys.stdin.readline().split()))

swaps = 0
visited = set()
for index in range(n):
    if index in visited:
        continue
    else:
        visited.add(index)
        length = 0
        value = nums[index]
        while (value != index + 1):
           visited.add(value - 1)
           value = nums[value - 1]
           length += 1
        swaps += length

if ((3 * n - swaps) % 2):
    print("Um_nik")
else:
    print("Petr")


import sys

n = int(sys.stdin.readline().rstrip())
nums = list(map(int, sys.stdin.readline().split()))

swaps = 0
visited = []
for index in range(n):
    if index in visited:
        continue
    else:
        visited.append(index)
        length = 0
        value = nums[index]
        while (value != index + 1):
           visited.append(value - 1)
           value = nums[value - 1]
           length += 1
        swaps += length

if ((3 * n - swaps) % 2):
    print("Um_nik")
else:
    print("Petr")


n = int(input())
l = [int(x) - 1 for x in input().split()]
parity = 0
explore = set(l)
while len(explore) > 0:
    x = min(explore)
    tmp = x
    found = [x]
    while l[tmp] != x:
        tmp = l[tmp]
        found.append(tmp)
    for i in found:
        explore.remove(i)
    parity ^= (len(found) - 1) % 2

if parity == n % 2:
    print("Petr")
else:
    print("Alex")


n = int(input())
l = [int(x) - 1 for x in input().split()]
parity = 0
explore = set(l)
while len(explore) > 0:
    x = min(explore)
    tmp = x
    found = [x]
    while l[tmp] != x:
        tmp = l[tmp]
        found.append(tmp)
    for i in found:
        explore.remove(i)
    parity |= (len(found) - 1) % 2

if parity & n:
    print("Petr")
else:
    print("Alex")


n = int(input())
l = [int(x) - 1 for x in input().split()]
parity = 0
explore = set(l)
while len(explore) > 0:
    x = min(explore)
    tmp = x
    found = [x]
    while l[tmp] != x:
        tmp = l[tmp]
        found.append(tmp)
    for i in found:
        explore.remove(i)
    parity ^= (len(found) - 1) % 2

if parity == n % 2:
    print("Petr")
else:
    print("Um_nik")


n = int(input())
l = [int(x) - 1 for x in input().split()]
parity = 0
explore = set(l)
while len(explore) > 0:
    x = min(explore)
    tmp = x
    found = [x]
    while l[tmp] != x:
        tmp = l[tmp]
        found.append(tmp)
    for i in found:
        explore.remove(i)
    parity ^= (len(found) - 1) % 2

if parity & n:
    print("Petr")
else:
    print("Alex")


n = int(input())
l = [int(x) - 1 for x in input().split()]
parity = 0
explore = set(l)
while len(explore) > 0:
    x = explore.pop()
    tmp = x
    found = [x]
    while l[tmp] != x:
        tmp = l[tmp]
        found.append(tmp)
    for i in found[1:]:
        explore.remove(i)
    parity ^= (len(found) - 1) % 2

if parity == n % 2:
    print("Petr")
else:
    print("Um_nik")


#-------------------solved------------
import time
import math
start = time.time()
x,y = map(int,input().split(' '))
a = y*math.log(x,10)

b = x*math.log(y,10)
if a>b:
    print('>')
else:
    if a<b:
        print('<')
    else:
        print('=')
end = time.time()


import random
n = int(input())
a = list(map(int,input().split(' ')))
c = 0
for i in range(1,n+1):
    if a[i-1]==i:
        c += 1

if c >= n//1000:
    print("Petr")
else:
    print("Um_nik")


n=int(input())
a=list(map(int,input().split()))
if sum(a[i]==i+1 for i in range(n))>=n//1000:print("Petr")
else:print("Um_nik")

# Made By Mostafa_Khaled


input()
a=list(map(int,input().split()))
n=len(a)
t=n
for i in range(n):
	j=i
	k=0
	while a[j]!=0:
		k+=1
		t=j
		j=a[j]-1
		a[t]=0
	if k>0:
		t+=1-k%2
s='Um_nik'
if t%2>0:
	s = 'Petr'
print(s)


input()
a=list(map(int,input().split()))
n=len(a)
u=n
for i in range(n):
	j=i
	k=0
	while a[j]>0:
		k+=1
		t=j
		j=a[j]-1
		a[t]=0
	if k>0:
		u+=1-k%2
s='Petr'
if u%2>0:
	s='Um_nik'
print(s)


input()
a=list(map(int,input().split()))
n=len(a)
t=n
for i in range(n):
	j=i
	k=0
	while a[j]!=0:
		k=1
		t=j
		j=a[j]-1
		a[t]=0
	if k>0:
		t+=k
s='Um_nik'
if t%2>0:
	s = 'Petr'
print(s)


import random
astr=input()
N=int(astr)
s=input()
sk=s.split(' ')
ml=[int(i) for i in sk]
kl=[0 for i in ml]
#for i in range(0, 7*N+2):
#    A=random.randint(0,N-1)
#    B=A
#    while(A==B):
#        B=random.randint(0,N-1)
#    swap=ml[A]
#    ml[A]=ml[B]
#    ml[B]=swap
#print(ml)
k=0
for i in range(0,N):
    if kl[i]==0:
        kl[i]=1
        j=ml[i]
        k=k+1
        while(kl[j-1]==0):
            kl[j-1]=1
            j=ml[j-1]

if k%2==0: print("Petr")
else: print("Um_nik")


n, cnt = int(raw_input()), 0
nums = map(int, raw_input().split())
for i in range(n):
    if nums[i] == i + 1:
        cnt += 1
print 'Petr' if (cnt >= n // 1000) else 'Um_nik'


#include<stdio.h>

enum {N = 1000000 + 10};

int n, a[N], res, kt[N];

int dfs(int x) {
    kt[x] = 1;
    //printf("%d ", x);
    if (kt[a[x]]) return 0;
    return dfs(a[x]) + 1;
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);

    for (int i = 1; i <= n; i++)
    if (!kt[i]) {
        res += dfs(i);
        //printf("\n");
    }
    //printf("%d ", res);
    if (res % 2 == 3 * n % 2) printf("Petr"); else printf("Um_nik");
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = (int)3e5 + 5;

int n;
int a[maxn];

int main() {
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  int cnt[2] = {1};
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    long long x;
    cin >> x;
    while (x) {
      a[i] += x & 1, x >>= 1;
    }
    if (a[i] > 0 && a[i] % 2 == 0) {
      --ans;
    }
    a[i] += a[i - 1];
    a[i] %= 2;
    ans += cnt[a[i]];
    cnt[a[i]]++;
  }
  cout << ans << endl;
  return 0;
}


# include <bits/stdc++.h>

# define y1 aasjdladljskdj

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef unsigned long long ull;

const int N = int(3e5) + 5;
const int inf = (int)1e9 + 7;

int n, a[N];
vector < int > all[80];
int p[N], l[N];
int odd[N], eve[N];
ll ans;

void solve(int pos, int r, int k){
  int e = l[pos];
  int sum = p[r] - p[pos - 1] ;
  if(sum % 2){
    ans += odd[pos - 1] - odd[e];
  } else{
    ans += eve[pos - 1] - eve[e];
  }
}

int main(){
  scanf("%d", &n);
  for(int i = 1; i <= n; ++i){
    ll x;
    scanf("%lld", &x);
    a[i] = __builtin_popcountll(x);
    p[i] = p[i - 1] + a[i];
    odd[i] = odd[i - 1] + (p[i] % 2 == 1);
    eve[i] = eve[i - 1] + (p[i] % 2 == 0);
  }
  stack < int > s;
  for(int i = n; i >= 1; --i){
    if(!s.empty() && a[s.top()] < a[i]){
      l[s.top()] = i;
      s.pop();
    }
  }
  while(!s.empty()){
    l[s.top()] = 0;
    s.pop();
  }
  /// (sum) % 2 = 0
  /// sum >= max * 2
  for(int r = 1; r <= n; ++r){
    int sum = 0;
    int mx = r;
    int L = 0;
    for(int l = r; l >= 1; --l){
      if(a[l] > a[mx]){
        mx = l;
      }
      sum += a[l];
      if(sum >= 130){
        L = l;
        break;
      }
      if(l != r && sum - a[mx] >= a[mx] && (sum ) % 2 == 0){
        ans++;
      }
    }
    if(L){
      if(a[L] != a[mx]){
        solve(L, r, 0);
        L = l[mx];
      }
      while(L){
        solve(L, r, 0);
        L = l[L];
      }
    }
  }
  int mx = 0;
  for(int i = 1; i <= n; ++i){
    mx = max(mx, a[i]);
    ans += (p[i] >= mx * 2 && p[i] % 2 == 0);
  }

  printf("%lld", ans);
  return 0;
}


# include <bits/stdc++.h>

# define y1 aasjdladljskdj

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef unsigned long long ull;

const int N = int(3e5) + 5;
const int inf = (int)1e9 + 7;

int n, a[N];
vector < int > all[80];
int p[N], l[N];
int odd[N], eve[N];
ll ans;

void solve(int pos, int r, int k){
  int e = l[pos];
  int sum = p[r] - p[pos] - k;
  if(sum % 2){
    ans += odd[pos - 1] - odd[e];
  } else{
    ans += eve[pos - 1] - eve[e];
  }
}

int main(){
  scanf("%d", &n);
  for(int i = 1; i <= n; ++i){
    ll x;
    scanf("%lld", &x);
    a[i] = __builtin_popcountll(x);
    p[i] = p[i - 1] + a[i];
    odd[i] = odd[i - 1] + (p[i] % 2 == 1);
    eve[i] = eve[i - 1] + (p[i] % 2 == 0);
  }
  stack < int > s;
  for(int i = n; i >= 1; --i){
    if(!s.empty() && a[s.top()] < a[i]){
      l[s.top()] = i;
      s.pop();
    }
  }
  while(!s.empty()){
    l[s.top()] = 0;
    s.pop();
  }
  /// (sum - max * 2) % 2 = 0
  /// sum >= max * 2
  for(int r = 1; r <= n; ++r){
    int sum = 0;
    int mx = r;
    int L = 0;
    for(int l = r; l >= 1; --l){
      if(a[l] > a[mx]){
        mx = l;
      }
      sum += a[l];
      if(sum >= 130){
        L = l;
        break;
      }
      if(l != r && sum - a[mx] >= a[mx] && (sum - a[mx] * 2) % 2 == 0){
        ans++;
      }
    }
    if(L){
      if(a[L] != a[mx]){
        solve(L, r, a[mx] * 2);
        L = l[mx];
      }
      while(L){
        solve(L, r, a[L] * 2);
        if(l[L] == 0){
          ans += ((p[r] - a[L] * 2) % 2 == 0);
        }
        L = l[L];
      }
    }
  }
  printf("%lld", ans);
  return 0;
}


# include <bits/stdc++.h>

# define y1 aasjdladljskdj

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef unsigned long long ull;

const int N = int(3e5) + 5;
const int inf = (int)1e9 + 7;

int n, a[N];
vector < int > all[80];
int p[N], l[N];
int odd[N], eve[N];
ll ans;

void solve(int pos, int r, int k){
  int e = l[pos];
  int sum = p[r] - p[pos] - k;
  if(sum % 2){
    ans += odd[pos - 1] - odd[e];
  } else{
    ans += eve[pos - 1] - eve[e];
  }
}

int main(){
  scanf("%d", &n);
  for(int i = 1; i <= n; ++i){
    ll x;
    scanf("%lld", &x);
    a[i] = __builtin_popcountll(x);
    p[i] = p[i - 1] + a[i];
    odd[i] = odd[i - 1] + (p[i] % 2 == 1);
    eve[i] = eve[i - 1] + (p[i] % 2 == 0);
  }
  stack < int > s;
  for(int i = n; i >= 1; --i){
    if(!s.empty() && a[s.top()] < a[i]){
      l[s.top()] = i;
      s.pop();
    }
  }
  while(!s.empty()){
    l[s.top()] = 0;
    s.pop();
  }
  /// (sum - max * 2) % 2 = 0
  /// sum >= max * 2
  for(int r = 1; r <= n; ++r){
    int sum = 0;
    int mx = r;
    int L = 0;
    for(int l = r; l >= 1; --l){
      if(a[l] > a[mx]){
        mx = l;
      }
      sum += a[l];
      if(sum >= 130){
        L = l;
        break;
      }
      if(l != r && sum - a[mx] >= a[mx] && (sum - a[mx] * 2) % 2 == 0){
        ans++;
      }
    }
    if(L){
      if(a[L] != a[mx]){
        solve(L, r, a[mx] * 2);
        L = l[mx];
      }
      while(L){
        solve(L, r, a[L] * 2);

        L = l[L];
      }
    }
  }
  int mx = 0;
  for(int i = 1; i <= n; ++i){
   mx = max(mx, a[i]);
    if(p[i] >= mx * 2 && p[i] % 2 == 0){
      ++ans;
    }
  }
  printf("%lld", ans);
  return 0;
}


# include <bits/stdc++.h>

# define y1 aasjdladljskdj

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef unsigned long long ull;

const int N = int(3e5) + 5;
const int inf = (int)1e9 + 7;

int n;
int a[N], odd, eve = 1;

int main(){
  scanf("%d", &n);
  for(int i = 1; i <= n; ++i){
    ll x;
    scanf("%lld", &x);
    a[i] = __builtin_popcountll(x);
  }
  ll ans = 0;
  int sum = 0;
  for(int i = 1; i <= n; ++i){
    sum += a[i];
    if(sum % 2){
      ans += odd;
      ++odd;
    } else{
      ans += eve;
      ++eve;
    }
  }
  for(int i = 1; i <= n; ++i){
    sum = 0;
    int mx = 0;
    for(int j = i; j <= n; ++j){
      sum += a[j];
      mx = max(mx, a[j]);
      if(sum < mx * 2 && sum % 2 == 0){
        --ans;
      }
    }
  }
  printf("%lld", ans);

  return 0;
}


# include <bits/stdc++.h>

# define y1 aasjdladljskdj

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef unsigned long long ull;

const int N = int(3e5) + 5;
const int inf = (int)1e9 + 7;

int n;
int a[N], l[N], r[N];
int p[N], odd[N], eve[N];

int main(){
  scanf("%d", &n);
  for(int i = 1; i <= n; ++i){
    ll x;
    scanf("%lld", &x);
    a[i] = __builtin_popcountll(x);
  }
  eve[0] = 1;
  for(int i = 1; i <= n; ++i){
    p[i] = p[i - 1] + a[i];
    odd[i] = odd[i - 1] + (p[i] % 2 == 1);
    eve[i] = eve[i - 1] + (p[i] % 2 == 0);
  }
  stack < int > s;
  for(int i = 1; i <= n; ++i){
    while(!s.empty() && a[s.top()] < a[i]){
      r[s.top()] = i;
      s.pop();
    }
    s.push(i);
  }
  while(!s.empty()){
    r[s.top()] = n + 1;
    s.pop();
  }
  for(int i = n; i >= 1; --i){
    while(!s.empty() && a[s.top()] <= a[i]){
      l[s.top()] = i;
      s.pop();
    }
    s.push(i);
  }
  while(!s.empty()){
    l[s.top()] = 0;
    s.pop();
  }
  ll ans = 0;
  for(int i = 1; i <= n; ++i){
    ans += (odd[i] - odd[l[i]]) * 1ll * (odd[r[i] - 1] - odd[i - 1]);
    ans += (eve[i] - eve[l[i]]) * 1ll * (eve[r[i] - 1] - eve[i - 1]);
    --ans;
    if(p[i] % 2 == 0 && i != 1){
      ++ans;
    }
  }
  printf("%lld", ans);

  return 0;
}


# include <bits/stdc++.h>

# define y1 aasjdladljskdj

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef unsigned long long ull;

const int N = int(3e5) + 5;
const int inf = (int)1e9 + 7;

int n, a[N];
vector < int > all[80];
int p[N], l[N];
int odd[N], eve[N];
ll ans;

void solve(int pos, int r, int k){
  int e = l[pos];
  int sum = p[r] - p[pos - 1] - k;
  if(sum % 2){
    ans += odd[pos - 1] - odd[e];
  } else{
    ans += eve[pos - 1] - eve[e];
  }
}

int main(){
  scanf("%d", &n);
  for(int i = 1; i <= n; ++i){
    ll x;
    scanf("%lld", &x);
    a[i] = __builtin_popcountll(x);
    p[i] = p[i - 1] + a[i];
    odd[i] = odd[i - 1] + (p[i] % 2 == 1);
    eve[i] = eve[i - 1] + (p[i] % 2 == 0);
  }
  stack < int > s;
  for(int i = n; i >= 1; --i){
    if(!s.empty() && a[s.top()] < a[i]){
      l[s.top()] = i;
      s.pop();
    }
  }
  while(!s.empty()){
    l[s.top()] = 0;
    s.pop();
  }
  /// (sum - max * 2) % 2 = 0
  /// sum >= max * 2
  for(int r = 1; r <= n; ++r){
    int sum = 0;
    int mx = r;
    int L = 0;
    for(int l = r; l >= 1; --l){
      if(a[l] > a[mx]){
        mx = l;
      }
      sum += a[l];
      if(sum >= 130){
        L = l;
        break;
      }
      if(l != r && sum - a[mx] >= a[mx] && (sum - a[mx] * 2) % 2 == 0){
        ans++;
      }
    }
    if(L){
      if(a[L] != a[mx]){
        solve(L, r, a[mx] * 2);
        L = l[mx];
      }
      while(L){
        solve(L, r, a[L] * 2);
        if(l[L] == 0){
          ans += ((p[r] - a[L] * 2) % 2 == 0);
        }
        L = l[L];
      }
    }
  }
  printf("%lld", ans);
  return 0;
}