Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random permutation this way: he takes identity permutation of numbers from $1$ to $n$ and then $3n$ times takes a random pair of different elements and swaps them. Alex envies Petr and tries to imitate him in all kind of things. Alex has also come up with a problem about random permutation. He generates a random permutation just like Petr but swaps elements $7n+1$ times instead of $3n$ times. Because it is more random, OK?!

You somehow get a test from one of these problems and now you want to know from which one.


-----Input-----

In the first line of input there is one integer $n$ ($10^{3} \le n \le 10^{6}$).

In the second line there are $n$ distinct integers between $1$ and $n$ — the permutation of size $n$ from the test.

It is guaranteed that all tests except for sample are generated this way: First we choose $n$ — the size of the permutation. Then we randomly choose a method to generate a permutation — the one of Petr or the one of Alex. Then we generate a permutation using chosen method.


-----Output-----

If the test is generated via Petr's method print "Petr" (without quotes). If the test is generated via Alex's method print "Um_nik" (without quotes).


-----Example-----
Input
5
2 4 5 1 3

Output
Petr



-----Note-----

Please note that the sample is not a valid test (because of limitations for $n$) and is given only to illustrate input/output format. Your program still has to print correct answer to this test to get AC.

Due to randomness of input hacks in this problem are forbidden.

Difficulty: MEDIUM_HARD

Solutions:
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]
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 = int(input())
arr = list(map(int, input().split()))
gap = n // 2
count = 0
while gap >= 1:
	for j in range(gap, n):
		i = j - gap
		while i >= 0:
			if arr[i + gap] > arr[i]:
				break
			else:
				(arr[i + gap], arr[i]) = (arr[i], arr[i + gap])
				count += 1
			i -= gap
	gap //= 2
if count % 2 == 3 * n % 2:
	print('Petr')
else:
	print('Um_nik')


n = int(input())
p = list(map(lambda x: int(x) - 1, input().split()))
vis = [False] * n
odd = 0
for x in range(n):
	if vis[x]:
		continue
	odd ^= 1
	while not vis[x]:
		odd ^= 1
		vis[x] = True
		x = p[x]
print('Petr' if (n + odd) % 2 == 0 else 'Um_nik')


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')


class BIT:
	__all__ = ['add', 'sumrange', 'lower_left']

	def __init__(self, maxsize=10 ** 7):
		assert maxsize > 0
		self._n = maxsize + 1
		self._bitdata = [0] * (maxsize + 1)

	def add(self, i, x):
		assert 0 <= i < self._n
		pos = i + 1
		while pos < self._n:
			self._bitdata[pos] += x
			pos += pos & -pos

	def running_total(self, i):
		assert -1 <= i < self._n
		if i == -1:
			return 0
		returnval = 0
		pos = i + 1
		while pos:
			returnval += self._bitdata[pos]
			pos -= pos & -pos
		return returnval

	def sumrange(self, lo=0, hi=None):
		if lo < 0:
			raise ValueError('lo must be non-negative')
		if hi is None:
			hi = self._n
		return self.running_total(hi) - self.running_total(lo - 1)

	def lower_left(self, total):
		if total < 0:
			return -1
		pos = 0
		k = 1 << self._n.bit_length() - 1
		while k > 0:
			if pos + k < self._n and self._bitdata[pos + k] < total:
				total -= self._bitdata[pos + k]
				pos += k
			k //= 2
		return pos

def tentousu(lis):
	bit = BIT()
	ans = 0
	for i in range(len(lis)):
		bit.add(lis[i], 1)
		ans += i + 1 - bit.running_total(lis[i])
	return ans
N = int(input())
L = list(map(int, input().split()))
a = tentousu(L)
a %= 2
if N % 2 == 0 and a % 2 == 0:
	print('Petr')
if N % 2 == 0 and a % 2 == 1:
	print('Um_nik')
if N % 2 == 1 and a % 2 == 0:
	print('Um_nik')
if N % 2 == 1 and a % 2 == 1:
	print('Petr')


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')


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')


n = int(input())
l = list(map(int, input().split()))
c = 1
ans = 0
vis = [0] * 1000005
for i in range(n):
	p = i
	vis[i + 1] = 1
	while vis[l[p]] != 1:
		ans -= -1
		vis[l[p]] = 1
		p = l[p] - 1
if 3 * n % 2 == ans % 2:
	print('Petr')
else:
	print('Um_nik')


def getIntList():
	return list(map(int, input().split()))
n = int(input())
s = getIntList()
s = [0] + s
seen = [False] * (n + 1)
sign = 1
for i in range(1, n + 1):
	length = 1
	if seen[i]:
		continue
	seen[i] = True
	j = s[i]
	while j != i:
		seen[j] = True
		j = s[j]
		length += 1
	if length % 2 == 0:
		sign *= -1
if n % 2 == 0:
	signPetr = 1
else:
	signPetr = -1
if signPetr == sign:
	print('Petr')
else:
	print('Um_nik')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=-10 ** 6, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(200001)]
pp = [0] * 200001

def SieveOfEratosthenes(n=200000):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1

def mergeSort(arr, n):
	temp_arr = [0] * n
	return _mergeSort(arr, temp_arr, 0, n - 1)

def _mergeSort(arr, temp_arr, left, right):
	inv_count = 0
	if left < right:
		mid = (left + right) // 2
		inv_count += _mergeSort(arr, temp_arr, left, mid)
		inv_count += _mergeSort(arr, temp_arr, mid + 1, right)
		inv_count += merge(arr, temp_arr, left, mid, right)
	return inv_count

def merge(arr, temp_arr, left, mid, right):
	i = left
	j = mid + 1
	k = left
	inv_count = 0
	while i <= mid and j <= right:
		if arr[i] <= arr[j]:
			temp_arr[k] = arr[i]
			k += 1
			i += 1
		else:
			temp_arr[k] = arr[j]
			inv_count += mid - i + 1
			k += 1
			j += 1
	while i <= mid:
		temp_arr[k] = arr[i]
		k += 1
		i += 1
	while j <= right:
		temp_arr[k] = arr[j]
		k += 1
		j += 1
	for loop_var in range(left, right + 1):
		arr[loop_var] = temp_arr[loop_var]
	return inv_count
n = int(input())
a = list(map(int, input().split()))
r = mergeSort(a, n)
if r % 2 == 3 * n % 2:
	print('Petr')
else:
	print('Um_nik')


n = int(input().strip())
ais = list(map(int, input().strip().split()))
visited = [False for _ in range(n)]
parity = 0
for i in range(n):
	if not visited[i]:
		parity += 1
		j = i
		while not visited[j]:
			visited[j] = True
			j = ais[j] - 1
if parity % 2 == 0:
	print('Petr')
else:
	print('Um_nik')


input()
a = list(map(int, input().split()))
m = 0
for i in range(len(a)):
	if a[i] > 0:
		m += 1
		while a[i] > 0:
			(a[i], i) = (-1, a[i] - 1)
print('Um_nik' if m & 1 else 'Petr')


n = int(input())
a = list(map(int, input().split()))
pos = {}
for i in range(n):
	pos[a[i]] = i
ct = 0
curr = 1
for i in range(n):
	if pos[curr] == i:
		curr += 1
		continue
	ct += 1
	j = pos[curr]
	pos[curr] = i
	pos[a[i]] = j
	curr += 1
	(a[i], a[j]) = (a[j], a[i])
if 3 * n < ct or 3 * n - ct & 1:
	print('Um_nik')
else:
	print('Petr')


import sys
input = sys.stdin.buffer.readline
n = int(input())
arr = list(map(int, input().split()))
gap = n // 2
count = 0
while gap >= 1:
	for j in range(gap, n):
		i = j - gap
		while i >= 0:
			if arr[i + gap] > arr[i]:
				break
			else:
				(arr[i + gap], arr[i]) = (arr[i], arr[i + gap])
				count += 1
			i -= gap
	gap //= 2
if count % 2 == 3 * n % 2:
	print('Petr')
else:
	print('Um_nik')


import sys
input = sys.stdin.readline

class Bit:

	def __init__(self, n):
		self.size = n
		self.tree = [0] * (n + 1)

	def sum(self, i):
		s = 0
		while i > 0:
			s += self.tree[i]
			i -= i & -i
		return s

	def add(self, i, x):
		while i <= self.size:
			self.tree[i] += x
			i += i & -i
n = int(input())
a = list(map(int, input().split()))
bi = Bit(n + 1)
c = 0
for (i, x) in enumerate(a):
	bi.add(x, 1)
	c += i + 1 - bi.sum(x)
if c % 2 == n % 2:
	print('Petr')
else:
	print('Um_nik')


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)


n = int(input())
a = [0] + list(map(int, input().split()))
d = {}
for i in range(1, n + 1):
	d[a[i]] = i
ans = 0
for i in range(1, n + 1):
	if a[i] != i:
		ind1 = d[a[i]]
		ind2 = d[i]
		va1 = a[i]
		val2 = i
		(a[ind1], a[ind2]) = (a[ind2], a[ind1])
		d[i] = i
		d[va1] = ind2
		ans += 1
if (3 * n - ans) % 2 == 0:
	print('Petr')
else:
	print('Um_nik')


print(('Um_nik', 'Petr')[int(input()) // 1000 <= sum((i == x for (i, x) in enumerate(map(int, input().split()), 1)))])


class BIT:

	def __init__(self, n):
		self.n = n
		self.bit = [0] * (self.n + 1)

	def init(self, init_val):
		for (i, v) in enumerate(init_val):
			self.add(i, v)

	def add(self, i, x):
		i += 1
		while i <= self.n:
			self.bit[i] += x
			i += i & -i

	def sum(self, i, j):
		return self._sum(j) - self._sum(i)

	def _sum(self, i):
		res = 0
		while i > 0:
			res += self.bit[i]
			i -= i & -i
		return res

	def lower_bound(self, x):
		s = 0
		pos = 0
		depth = self.n.bit_length()
		v = 1 << depth
		for i in range(depth, -1, -1):
			k = pos + v
			if k <= self.n and s + self.bit[k] < x:
				s += self.bit[k]
				pos += v
			v >>= 1
		return pos

	def __str__(self):
		arr = [self.sum(i, i + 1) for i in range(self.n)]
		return str(arr)
n = int(input())
P = list(map(int, input().split()))
bit = BIT(n + 5)
x = 0
for p in P:
	x += bit.sum(p + 1, bit.n)
	bit.add(p, 1)
if n % 2 == 0:
	if x % 2 == 0:
		print('Petr')
	else:
		print('Um_nik')
elif x % 2 == 0:
	print('Um_nik')
else:
	print('Petr')


from collections import *
from itertools import permutations

def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def st():
	return input().rstrip('\n')

def val():
	return int(input())

def do(i):
	global tot, l
	temp = l[i]
	l[i] = l[l[i]]
	l[temp] = temp
	tot += 1
n = val()
l = [0] + li()
tot = 0
for i in range(1, n + 1):
	while l[i] != i:
		do(i)
print('Petr' if tot % 2 == n % 2 else 'Um_nik')


import math
n = int(input())
a = list(map(int, input().split()))
if n < 10:
	print('Petr')
else:
	print(['Petr', 'Um_nik'][sum((a[i] == i + 1 for i in range(n))) < math.log(n) / 3])


n = int(input())
a = list(map(lambda x: int(x) - 1, input().split(' ')))
ret = True
for i in range(n):
	if a[i] == -1:
		continue
	(x, ret) = (i, not ret)
	while a[x] != i:
		(a[x], x) = (-1, a[x])
	a[x] = -1
if ret:
	print('Petr')
else:
	print('Um_nik')


def main():
	n = int(input())
	if n == 5:
		print('Petr')
		return
	a = list(map(int, input().split()))
	count = 0
	for i in range(n):
		if a[i] == i + 1:
			count += 1
	if count < n // 1000:
		print('Um_nik')
	else:
		print('Petr')
main()


from sys import stdin
n = int(stdin.readline())
p = [int(x) - 1 for x in stdin.readline().split()]
visited = [False for x in range(n)]
loops = []
for x in range(n):
	if not visited[x]:
		visited[x] = True
		start = x
		l = [x]
		cur = p[x]
		while cur != start:
			visited[cur] = True
			l.append(cur)
			cur = p[cur]
		loops.append(len(l) - 1)
tot = sum(loops)
if n % 2 == 1:
	if tot % 2 == 1:
		print('Petr')
	else:
		print('Um_nik')
elif tot % 2 == 0:
	print('Petr')
else:
	print('Um_nik')


class BIT:

	def __init__(self, n):
		self.n = n
		self.bit = [0] * (n + 1)

	def add(self, i, val):
		i = i + 1
		while i <= self.n:
			self.bit[i] += val
			i += i & -i

	def _sum(self, i):
		s = 0
		while i > 0:
			s += self.bit[i]
			i -= i & -i
		return s

	def sum(self, i, j):
		return self._sum(j) - self._sum(i)
n = int(input())
a = list(map(int, input().split()))
bit = BIT(n)
ans = 0
for i in range(len(a)):
	bit.add(a[i] - 1, 1)
	ans += bit.sum(a[i], n)
if ans % 2 == n % 2:
	print('Petr')
else:
	print('Um_nik')


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:
	if ans % 2 == 0:
		print('Petr')
	else:
		print('Um_nik')
elif ans % 2 == 0:
	print('Petr')
else:
	print('Um_nik')


def read():
	return int(input())

def readmap():
	return map(int, input().split())

def readlist():
	return list(map(int, input().split()))
N = read()
P = readlist()

def is_even(P):
	checked = [False] * (N + 1)
	num_of_even_cycles = 0
	for n in range(1, N + 1):
		if checked[n]:
			continue
		checked[n] = True
		len_cyc = 1
		nxt = P[n - 1]
		while not checked[nxt]:
			checked[nxt] = True
			nxt = P[nxt - 1]
			len_cyc += 1
		if len_cyc % 2 == 0:
			num_of_even_cycles += 1
	if num_of_even_cycles % 2 == 0:
		return True
	else:
		return False
if N % 2 == 0:
	if is_even(P):
		print('Petr')
	else:
		print('Um_nik')
elif not is_even(P):
	print('Petr')
else:
	print('Um_nik')


n = int(input())
a = list(map(int, input().split()))
b = [x for x in range(1, n + 1)]
c = [(x, y) for (x, y) in zip(a, b)]
d = set(c)
cnt = 0
while d:
	x = d.pop()
	sti = x[1]
	while x[0] != sti:
		x = c[x[0] - 1]
		cnt += 1
		if x in d:
			d.remove(x)
		else:
			break
if cnt % 2 == n * 3 % 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 = 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')


n = int(input())
u = list(map(int, input().split()))
for i in range(n):
	u[i] -= 1
ans = 0
for i in range(n):
	if u[i] == -1:
		continue
	ans = 1 - ans
	x = i
	while x >= 0:
		y = u[x]
		u[x] = -1
		x = y
if ans:
	print('Um_nik')
else:
	print('Petr')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)

def ctd(chr):
	return ord(chr) - ord('a')
mod = 998244353
INF = float('inf')
(p, u) = ('Petr', 'Um_nik')

def main():
	n = N()
	arr = RLL()
	vis = [0] * (n + 1)
	dic = {v: i + 1 for (i, v) in enumerate(arr)}
	sm = 0
	for i in range(1, n + 1):
		if vis[i] == 0:
			now = i
			vis[now] = 1
			while dic[now] != i:
				sm += 1
				now = dic[now]
				vis[now] = 1
	if (3 * n - sm) % 2 == 0:
		print(p)
	else:
		print(u)
main()


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n
avl = AvlTree()

class SegmentTree1:

	def __init__(self, data, default='z', func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
n = int(input())
l = list(map(int, input().split()))
a = [0] * n
s = SegmentTree(a)
inv = 0
for i in range(n):
	inv += s.query(l[i] - 1, n - 1)
	s.__setitem__(l[i] - 1, 1)
if inv % 2 == 3 * n % 2:
	print('Petr')
else:
	print('Um_nik')