n = int(raw_input())

arr = map(int, raw_input().split())

# only care about permutations which are one big cycle

d = {}
arr2 = sorted(arr)
for i in range(n):
    d[arr2[i]] = arr2[(i + 1) % n]
    #print i - 1, arr[i], arr[i - 1]
for i in range(n):
    arr[i] = d[arr[i]]

print " ".join(map(str, arr))

n = int(input())
j = [int(x) for x in input().split(" ")]
if n ==1:
    print(j[0])
else:
    k = [[j[i],i] for i in range(n)]
    k.sort()
    o = [0 for i in range(len(k))]
    for i in range(len(k)):
        o[k[i][1]] = str(k[(i+1)%n][0])

    print(" ".join(o))

n  = int(input())
a  = list(map(int, input().split()))

def solve(n, a):
    if n == 1:
        return [str(a[0])]

    arr = [[x, i] for i, x in enumerate(a)]
    arr = sorted(arr, key=lambda x:x[0])
    ans = [-1] * n

    for [x, i], [y, j] in zip(arr[1:], arr[:-1]):
        ans[j] = str(x)

    ans[arr[-1][1]] = str(arr[0][0])

    return ans

ans = solve(n, a)

print(' '.join(ans))

n=int(input())

a=list(map(int,input().split()))
b=a.copy()
a.sort()
c=[]
for i in range(n):
    c.append(a[(a.index(b[i])+1)%n])
print(*c)

n = int(input())
l = [int(i) for i in input().split(" ")]
nums = sorted(l)

# index = []
# for i in l:
#     index.append(nums.index(i))
# #print(index)
# indexbis = [int(i - 1) for i in index]
#
# for i in range(n):
#     if indexbis[i] == min(indexbis):
#         indexbis[i] = n - 1
#         break
# #print(indexbis)
# for i in indexbis:
#     print(l[index.index(i)], end = " ")

# Way of shifting array by 1

for i in l:
    print(nums[(nums.index(i) + 1)  % n], end = " ")

'''
shuffle an array of integer such that new
new array formed by shuffling will not have any
subset whose sum is equal to sum of same indexed subset
of the original array

Examples
input
2
1 2
output
2 1
input
4
1000 100 10 1
output
100 1 1000 10

'''
n = int(input())
a = list(map(int, input().split()))
sorted_a = sorted(a)
shifted_sorted_a = [sorted_a[-1]] + sorted_a[:-1]
for i in range(len(a)):
    pos_in_sorted = sorted_a.index(a[i])
    print(shifted_sorted_a[pos_in_sorted], end=" ")

n = int(input())
lst = [int(i) for i in input().split()]
for elem in lst:
    print(sorted(lst)[sorted(lst).index(elem)-1])

n, a = int(input()), list(map(int, input().split()))
b = sorted(a) + [min(a)]
print(' '.join([str(b[b.index(a[i]) + 1]) for i in range(n)]))

n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
for i in range(n):
	print (b[(b.index(a[i]) + 1) % n],end=" ")

n = int(input())
a = list(map(int , input().split()))
ans = list()
for i in range(n):
    ans.append(0)
position = dict()
for i in range(n):
    position[a[i]] = i;
a = sorted(a)
ans[position[a[n - 1]]] = a[0];
for i in range(n - 1):
    ans[position[a[i]]] = a[i + 1]
for i in range(n):
    print(ans[i] , end = " ")

n=int(input())
a=list(map(int,input().split()))
b = sorted(a) + [min(a)]
for i in range(n):print(b[b.index(a[i])+1],end=' ')

n = int(input())
A = input().split()
A = [int(i) for i in A]
if n != len(set(A)):
    print (-1)
else:
    B = A[:]
    B.sort()
    C = [n+100]*n
    for i in range (0,n):
        C[i] = A.index(B[i])
    D = [n+100]*n
    for i in range (0,n):
        D[C[i]] = A[C[(i+1)%n]]
    for x in D:
        print(x, end=" ")
    print()

n=int(input())
a=list(map(int,input().split()))
b=sorted(a)+[min(a)]
for i in range(n):
    a[i]=str(b[b.index(a[i])+1])
print(' '.join(a))

def solve():
    n=int(input())
    a=list(map(int,input().split()))
    b=sorted(a)+[min(a)]
    for i in range(n):
        a[i]=str(b[b.index(a[i])+1])
    print(' '.join(a))
    return
solve()

inf = lambda : map(int, input().split())
n, = inf()
a = list(inf())
p = sorted([i for i in range(n)], key=lambda x : a[x])
b = [0]*n
for i in range(n):
	b[p[i]] = a[p[(i+1)%n]]
for i in range(n):
	print(b[i], end=' ')
print()

n = int(input())
a = list(map(int, input().split()))
sorted_a = sorted(a)
shifted_sorted_a = [sorted_a[-1]] + sorted_a[:-1]
#print(sorted_a)
#print(shifted_sorted_a)
for i in range(len(a)):
	pos_in_sorted = sorted_a.index(a[i])
	print(shifted_sorted_a[pos_in_sorted], end=" ")
print()

n = int(input())
a = [int(i) for i in input().split()]
b = sorted(a)
s = {}
for i in range(-1, n-1): s[b[i+1]] = b[i]
print(' '.join([str(s[i]) for i in a]))

import sys
input()
a = list(map(int, input().split()))
b = sorted(a)
for i in a:
	sys.stdout.write(str(b[b.index(i)-1]))
	sys.stdout.write(" ")
sys.stdout.write("\n")

n = int(input())
L = list(map(int, input().split()))
S = sorted(L)
for i in L:
    print(S[(S.index(i) + 1)%n], end=' ')

# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys

"""
created by shhuan at 2017/11/17 22:54

"""

N = int(input())

A = [int(x) for x in input().split()]

wc = collections.Counter(A)
if any(v > 1 for v in wc.values()):
    print(-1)
    exit(0)

C = list(sorted(A))

NC = {C[i]: C[i+1] for i in range(N-1)}
NC[C[-1]] = C[0]

ans = []
for v in A:
    ans.append(NC[v])

print(" ".join(map(str, ans)))

input()
t = list(map(int, input().split()))
s = sorted(t)
for q in t: print(s[s.index(q) - 1])

input()
t, s = zip(*sorted((int(q), i) for i, q in enumerate(input().split())))
for i, q in sorted((i, q) for q, i in zip(t[1:] + t[:1], s)): print(q)

import math
n = int(input())
a = list(map(int, input().split()))
pos = {}
ans = []
for i in range(n) :
	pos[a[i]] = i
	ans.append(0)
a.sort()
ans[pos[a[n - 1]]] = a[0]
for i in range(n - 1) :
	ans[pos[a[i]]] = a[i + 1]
for i in ans :
	print(i, end = ' ')

n, a = int(input()), list(map(int, input().split()))
b = sorted(a) + [min(a)]
print(' '.join([str(b[b.index(a[i]) + 1]) for i in range(n)]))

input()

a = list(map(int, input().split()))

for i in a:

    print(sorted(a)[sorted(a).index(i)-1])

# Made By Mostafa_Khaled

n = int(input())
a = [int(i) for i in input().split()]
if n == 1:
    print(a[0])
else:
    a_with_index = [[a[i], i] for i in range(n)]
    a_with_index.sort()
    ans = [0 for i in range(n)]
    for i in range(n):
        ans[a_with_index[i][1]] = str(a_with_index[(i + 1) % n][0])
    print(" ".join(ans))

n = input()
a = map(int, raw_input().split())
b = sorted(a)
for i in range(n):
	print b[(b.index(a[i]) + 1) % n],

input()
a = list(map(int, input().split()))
for i in a:
    print(sorted(a)[sorted(a).index(i)-1])

n = int(raw_input())
a = map(int,raw_input().split())
b = [[0]*2 for _ in range(n)]
ans = [0]*n
for i in range(n):
	b[i] = [a[i],i]
b = sorted(b)
for i in range(n):
	ans[b[i][1]] = b[(i+1)%n][0]
for i in ans:
	print i,

n = int(raw_input())
a = map(int, raw_input().split())
b = [(x, i) for i, x in enumerate(a)]
b.sort()
c = b[1:] + [b[0]]
ans = [0] * n
for i, x in enumerate(b):
    ans[x[1]] = c[i][0]
for x in ans:
    print x,
print

input()
a = map(int, raw_input().split())
for i in a:
	print sorted(a)[sorted(a).index(i)-1],

n=input()
a=map(int,raw_input().split())
b=sorted(a)
f={}
for i in range(n):
	f[b[i]]=i
for x in a:
	print b[(f[x]+1)%n],

n=input()
a=map(int,raw_input().split())
b=sorted(a[:])
m={}
for i in range(n):m[b[i]]=i
print " ".join([str(b[(m[x]+1)%n]) for x in a])

n = int(raw_input())
l1 = map(int, raw_input().split())
l = [i for i in l1]
l.sort()
m = []
for i in l1:
    if i == l[-1]:
        m.append(l[0])
    else:
        for j in l:
            if j > i:
                m.append(j)
                break
print " ".join(map(str,m))

# 1: no one can be in their original position
n = int(raw_input())
b = map(int, raw_input().split())

c = [(t, i) for i, t in enumerate(b)]
c.sort()

d = [0 for i in range(n)]

for i in range(n - 1):
    d[c[i+1][-1]] = c[i][0]
d[c[0][-1]] = c[-1][0]

for t in d:
    print t,

n = int(raw_input())
nums = list(map(int,raw_input().split()))
temp = sorted(nums)
ans = [0 for x in range(n)]
for i in range(n):
  ans[nums.index(temp[i])] = temp[(i+1)%n]
print " ".join([str(x) for x in ans])

n=input()
a=list(map(int,raw_input().split()))
b = sorted(a) + [min(a)]
for i in range(n):print(b[b.index(a[i])+1]);end=' '

n=input()
a=map(int,raw_input().split())
b=sorted(a)
f={}
for i in range(n):f[b[i]]=i
for x in a:print b[(f[x]+1)%n],

n = int(input())
A = list(map(int, input().split()))
B = sorted(A)
for i in A:
    print(B[B.index(i) - 1], end=' ')

n = int(input())
*a, = map(int, input().split())
b = sorted(a)
for i in a:
    print(b[(b.index(i) + 1) % n], end=' ')

n, a = int(input()), [int(i) for i in input().split()]
b, m = a[:], dict()
b.sort()
for i in range(len(b) - 1):
    m[b[i]] = b[i + 1]
m[b[-1]] = b[0]
for i in range(len(a)):
    a[i] = m[a[i]]
if len(set(b)) == n:
    print(*a)
else:
    print(-1)

n = int(input())
l = [int(i) for i in input().split(" ")]
index = []
nums = sorted(l)
for i in l:
    index.append(nums.index(i))
#print(index)
indexbis = [int(i - 1) for i in index]

for i in range(n):
    if indexbis[i] == min(indexbis):
        indexbis[i] = n - 1
        break
#print(indexbis)
for i in indexbis:
    print(l[index.index(i)], end = " ")

n = int(input())
A = [int(a) for a in input().split(' ')]
R = sorted(A)

for i in range(n):
    if A[i] == R[-1]:
        A[i] = R[0]
    else:
        A[i] = R[R.index(A[i])+1]

print(' '.join([str(a) for a in A]))

n, a = int(input()), list(map(int, input().split()))
b = sorted(a) + [min(a)]
print(' '.join([str(b[b.index(a[i]) + 1]) for i in range(n)]))

n = int(input())
data = list(map(int, input().split()))

sorted_data = sorted(data)

ans = {}
for i in range(0, n):
    ans[sorted_data[i]] = sorted_data[(i + 1) % n]

for v in data:
    print(ans[v], end=' ')

import sys, math
readline = sys.stdin.readline

n = int(readline())
inf = pow(10,10)
tmp = list(map(int,readline().split()))
tmp2 = [inf] * n
mai = 0
for i in range(n):
    for j in range(n):
        if tmp[i] < tmp[j]:
            tmp2[i] = min(tmp2[i],tmp[j])

for i in range(n):
    if tmp[i] == max(tmp):
        mai = i
        break
tmp2[mai] = min(tmp)
for x in tmp2:
    print(x,end=' ')

#!/usr/bin/env python3

n = int(input())
A = list(map(int,input().split()))
S = sorted(A) #sorted((A[i],i) for i in range(n))
P = {S[i]:S[(i+1)%n] for i in range(n)}
B = [P[a] for a in A]
print(' '.join(map(str,B)))

n=int(input())
a=list(map(int,input().split()))
ans=sorted(a)+[min(a)]
print(' '.join([str(ans[ans.index(a[i])+1]) for i in range(n)]))

#!/usr/bin/env python3

n = int(input())
L = list(map(int,input().split()))
cpt = 0
a = n-1
for i in range(n-1,-1,-1):
    if a>=i:
        cpt += 1
    a = min(a,i-L[i]-1)
print(cpt)

n=int(input())
a=list(map(int,input().split()))
a.append(a[0])
print(' '.join([str(a[i]) for i in range(1,n+1)]))

n=int(input())
a=list(map(int,input().split()))
ans=sorted(a)+[min(a)]
print(ans)
print(' '.join([str(ans[ans.index(a[i])+1]) for i in range(n)]))

n = int(input())
j = [int(x) for x in input().split(" ")]
if n ==1:
    print(-1)
else:
    k = [[j[i],i] for i in range(n)]
    k.sort()

    l = [str(j[(x[1]+1)%n]) for x in k]

    print(" ".join(l))

n = int(input())

if n ==1:
    print(-1)
else:
    j = [int(x) for x in input().split(" ")]
    k = [[j[i],i] for i in range(n)]
    k.sort()

    l = [str(j[(x[1]+1)%n]) for x in k]

    print(" ".join(l))

n = int(input())
j = [int(x) for x in input().split(" ")]
k = [[j[i],i] for i in range(n)]
k.sort()

l = [str(j[(x[1]+1)%n]) for x in k]

print(" ".join(l))

n = int(input())
j = [int(x) for x in input().split(" ")]
if n ==1:
    print(-1)
else:
    k = [[j[i],i] for i in range(n)]
    k.sort()
    o = [0 for i in range(len(k))]
    for i in range(len(k)):
        o[k[i][1]] = str(k[(i+1)%n][0])

    print(" ".join(o))

n=int(input())
l=list(map(int,input().strip().split()))
l.sort()
for i in range(1,n):
	print (l[i],end=" ")
print (l[0])

n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
print (b)
for i in range(n):
	print (b[(b.index(a[i]) + 1) % n],end=" ")

n = int(input())
A = input().split()
A = [int(i) for i in A]
if n != len(set(A)):
    print (-1)
else:
    B = A[:]
    B.sort()
    C = [n+100]*n
    for i in range (0,n):
        C[i] = A.index(B[i])
    D = [n+100]*n
    for i in range (0,n):
        D[C[i]] = A[C[n-1-i]]
    for x in D:
        print(x, end=" ")
    print()

n = int(input())
a = list(map(int, input().split()))

ca = sorted([i for i in a])
ca = [ca[-1]] + ca[:-1]
if ca == a:
    print(-1)
    exit()
print(' '.join([str(i) for i in ca]))

n = int(input())
a = list(map(int, input().split()))

ca = sorted(a)
ca = [a[-1]] + a[:-1]
if ca == a:
    print(-1)
    exit()
print(' '.join([str(i) for i in a]))

n = int(input())
a = list(map(int, input().split()))

ca = sorted([i for i in a])
ca = ca[1:] + [ca[0]]
if ca == a:
    print(-1)
    exit()
print(' '.join([str(i) for i in ca]))

n = int(input())
a = [i for i in input().split()]
b = sorted(a)
s = {}
for i in range(-1, n-1): s[b[i+1]] = b[i]
print(' '.join([s[i] for i in a]))

n = int(input())
a = [i for i in input().split()]
b = (a[1:]+[a[0]])
if b == a: print (-1)
else: print(' '.join(b))

n = int(input())
a = [i for i in input().split()]
b = (a[1:]+[a[0]])
if n == 1: print(a[0])
elif b == a: print (-1)
else: print(' '.join(b))

# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys

"""
created by shhuan at 2017/11/17 22:54

"""

N = int(input())

A = [int(x) for x in input().split()]

def check(a, b):

    if not a and not b:
        return True

    if len(a) == 1 and len(b) == 1:
        return a[0] != b[0]

    if sum(a) == sum(b):
        return False

    na, nb = len(a), len(b)
    al, ar = a[:na//2], a[na//2:]
    bl, br = b[:nb//2], b[nb//2:]

    if check(al, bl) and check(ar, br):
        return True

    return False

def dfs(a, ais, b):
    if not ais:
        print(" ".join(map(str, b)))
        return True
    if b and not check(a[:len(b)], b):
        return False
    for i in ais:
        if dfs(a, ais - {i}, b+[a[i]]):
            return True

    return False

if not dfs(A, {i for i in range(N)}, []):
    print(-1)

# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys

"""
created by shhuan at 2017/11/17 22:54

"""

N = int(input())

A = [int(x) for x in input().split()]

def check(a, b):

    if not a and not b:
        return True

    if len(a) == 1 and len(b) == 1:
        return a[0] != b[0]

    if sum(a) == sum(b):
        return False

    na, nb = len(a), len(b)
    al, ar = a[:na//2], a[na//2:]
    bl, br = b[:nb//2], b[nb//2:]

    if check(al, bl) and check(ar, br):

        als = {0}
        for v in al:
            als |= {u + v for u in als}
        bls = {0}
        for v in bl:
            bls |= {u+v for u in bls}

        ars = {0}
        for v in ar:
            ars |= {u+v for u in ars}

        brs = {0}
        for v in br:
            brs |= {u+v for u in brs}

        als.remove(0)
        bls.remove(0)
        ars.remove(0)
        brs.remove(0)

        return not {u+v for u in als for v in ars} & {u+v for u in bls for v in brs}

    return False

def check2(a, b):
    pass

def dfs(a, ais, b):
    if not ais:
        if a[-1] != b[-1]:
            print(" ".join(map(str, b)))
            return True
    if b and not check(a[:len(b)], b):
        return False
    for i in ais:
        if dfs(a, ais - {i}, b+[a[i]]):
            return True

    return False

if not dfs(A, {i for i in range(N)}, []):
    print(-1)

# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys

"""
created by shhuan at 2017/11/17 22:54

"""

N = int(input())

A = [int(x) for x in input().split()]

def check(a, b):

    if not a and not b:
        return True

    if len(a) == 1 and len(b) == 1:
        return a[0] != b[0]

    if sum(a) == sum(b):
        return False

    na, nb = len(a), len(b)
    al, ar = a[:na//2], a[na//2:]
    bl, br = b[:nb//2], b[nb//2:]

    if check(al, bl) and check(ar, br):
        return True

    return False

def check2(a, b):
    pass

def dfs(a, ais, b):
    if not ais:
        if a[-1] != b[-1]:
            print(" ".join(map(str, b)))
            return True
    if b and not check(a[:len(b)], b):
        return False
    for i in ais:
        if dfs(a, ais - {i}, b+[a[i]]):
            return True

    return False

if not dfs(A, {i for i in range(N)}, []):
    print(-1)

n = int(raw_input())
a = map(int,raw_input().split())
b = [0]*n
for i in range(n):
	b[i] = a[i]
a = sorted(a)
for i in range(n):
	a[i] = b[(i+1)%n]
for i in a:
	print i,

n = int(raw_input())
a = map(int,raw_input().split())
b = [[0]*2 for _ in range(n)]
ans = [0]*n
for i in range(n):
	b[i] = [a[i],i]
a = sorted(a)
for i in range(n):
	ans[b[i][1]] = b[(i+1)%n][0]
for i in ans:
	print i,

n = int(raw_input())
a = map(int,raw_input().split())
b = [0]*n
ans = [0]*n
for i in range(n):
	b[i] = a[i]
a = sorted(a)
for i in range(n):
	ans[(i+1)%n] = a[i]
for i in ans:
	print i,

n = int(raw_input())
a = map(int,raw_input().split())
b = [0]*n
for i in range(n):
	b[i] = a[i]
i = 0
while i<(int(n/2)+1):
	a[i],a[i+1] = a[i+1],a[i]
	a[i+1],a[n-1] = a[n-1],a[i+1]
	i += 2
t = False
for i in range(n):
	if b[i]==a[i]:
		t = True
	else:
		t = False
		break
if t:
	print -1
else:
	for i in a:
		print i,

n = int(raw_input())

arr = map(int, raw_input().split())

# only care about permutations which are one big cycle

d = {}
arr2 = sorted(arr)
for i in range(n):
    d[arr[i]] = arr2[i - 1]

for i in range(n):
    arr[i] = d[arr[i]]

print " ".join(map(str, arr))

n = int(raw_input())
nums = list(map(int,raw_input().split()))
print " ".join([str(x) for x in [nums[-1]]+nums[:-1]])

n = int(input())
*a, = map(int, input().split())
b = sorted(a)
for i in a:
    print(a[(b.index(i) + 1) % n], end=' ')

import sys, math
readline = sys.stdin.readline

n = int(readline())
inf = pow(10,10)
tmp = list(map(int,readline().split()))
m = min(tmp)
mi = 0
for i in range(n):
    if tmp[i] == m:
        mi = i
for i in range(n):
    tp = inf
    k = 0
    for j in range(n):
        if tmp[j] > tmp[i] and tmp[j] <= tp:
            tp = tmp[j]
            k = j
    if tp == inf:
        tp = m
        k = mi
    tmp[k], tmp[i] = tmp[i], tp
for x in tmp:
    print(x,end=' ')

import sys, math
readline = sys.stdin.readline

n = int(readline())
inf = pow(10,10)
tmp = list(map(int,readline().split()))
m = min(tmp)
mi = 0
for i in range(n):
    if tmp[i] == m:
        mi = i
s = set()
for i in range(n):
    if i not in s:
        tp = inf
        k = 0
        for j in range(n):
            if tmp[j] > tmp[i] and tmp[j] <= tp:
                tp = tmp[j]
                k = j
        if tp == inf:
            tp = m
            k = mi
        tmp[k], tmp[i] = tmp[i], tp
        s.add(i)
        s.add(k)
for x in tmp:
    print(x,end=' ')

import sys, math
readline = sys.stdin.readline

n = int(readline())

tmp = list(map(int,readline().split()))
tmp.sort()
tmp1 = [tmp[n - 1]]
for i in range(n - 1):
    tmp1.append(tmp[i])

for x in tmp1:
    print(x,end=' ')

import sys, math
readline = sys.stdin.readline

n = int(readline())

tmp = list(map(int,readline().split()))
tmp1 = [tmp[n - 1]]
for i in range(n - 1):
    tmp1.append(tmp[i])

for x in tmp1:
    print(x,end=' ')

import sys, math
readline = sys.stdin.readline

n = int(readline())
inf = pow(10,10)
tmp = list(map(int,readline().split()))
m = min(tmp)
mi = 0
for i in range(n):
    if tmp[i] == m:
        mi = i
s = set()
for i in range(n):
    if i not in s:
        tp = inf
        k = 0
        for j in range(n):
            if j not in s:
                if tmp[j] > tmp[i] and tmp[j] <= tp:
                    tp = tmp[j]
                    k = j
        if tp == inf:
            tp = m
            k = mi
        tmp[k], tmp[i] = tmp[i], tp
        s.add(i)
        s.add(k)
for x in tmp:
    print(x,end=' ')

n=int(input())

a=list(map(int,input().split()))
b=a.copy()
a.sort()
c=[]
for i in range(n):
    c.append(a[(a.index(b[i])+1)%n])
print(c)

n=int(input())
if n<2:exit(print(-1))
a=sorted(list(map(int,input().split())))
print(a[-1],end=' ')
for i in range(n-1):
    print(a[i],end=' ')

n=int(input())
a=list(map(int,input().split()))
print(a[-1],end=' ')
for i in range(n-1):
    print(a[i],end=' ')

n=int(input())
a=list(map(int,input().split()))
b=[i for i in a[1:]]
b.append(a[0])
for i in range(n):
    for j in range(i,n):
        if sum(a[i:j+1])==sum(b[i:j+1]) and j-i<n-1:
            exit(print(-1))
for i in b:
    print(i,end=' ')

n=int(input())
a=list(map(int,input().split()))
print(*a[1:],end=' ')
print(a[0])

n=int(input())
a=list(map(int,input().split()))
b=[i for i in a[1:]]
b.extend((a[0],0))
ans=[i for i in b]
a.append(0)
for i in range(n,1,-1):
    for j in range(i):
        if a[j]==b[j]:exit(print(-1))
        a[j]+=a[j+1]
        b[j]+=b[j+1]
for i in ans[:n]:
    print(i,end=' ')

n=int(input())
a=list(map(int,input().split()))
b=[i for i in a[1:]]
b.append(a[0])
for i in range(n):
    for j in range(i,n):
        if sum(a[i:j+1])==sum(b[i:j+1]):exit(print(-1))
for i in b:
    print(i,end=' ')

n=int(input())
if n<2:exit(print(-1))
a=list(map(int,input().split()))
print(a[-1],end=' ')
for i in range(n-1):
    print(a[i],end=' ')

n=int(input())
a=list(map(int,input().split()))
b=[i for i in a[1:]]
b.extend((a[0],0))
ans=[i for i in b]
a.append(0)
for i in range(n,1,-1):
    for j in range(i):
        if a[j]==b[j]:exit(print(-1))
        a[j]+=a[j+1]
        b[j]+=b[j+1]
print(ans[:n])

n=int(input())
a=list(map(int,input().split()))
print(a[-1],end=' ')
for i in range(1,n):
    print(a[i],end=' ')

n=int(input())
a=list(map(int,input().split()))
b=[i for i in a[1:]]
b.append(a[0])
for i in range(n):
    for j in range(i,n):
        if sum(a[i:j+1])==b[i:j+1]:exit(print(-1))
for i in b:
    print(i,end=' ')

n=int(input())
a=input().split()
print(' '.join(a[1:]+[a[0]]))

n = int(input())
l = list(map(str, input().split()))
m = list(l)
c = 0
while c < n - 1:
	if l[c] == m[c]:
		t = m[c]
		m.pop(c)
		m.append(t)
	else:
		c += 1
print(" ".join(m))

input()
L = list(map(int, input().split()))
L = sorted(L)
L.insert(0, L[-1])
L.pop(-1)
print(*L)

input()
L = list(map(int, input().split()))
L = sorted(L)
L.append(L[0])
L.pop(0)
print(*L)

input()
t = input()
i = t.find(' ')
print(-1 if i < 0 else t[i + 1:] + ' ' + t[:i])

t = input()
i = t.find(' ')
print(-1 if i < 0 else t[i + 1:] + ' ' + t[:i])

# 1: no one can be in their original position
n = int(raw_input())
b = map(int, raw_input().split())
b.sort()
for t in b[1:] + b[:1]:
    print t,

n = int(input())
A = list(map(int, input().split()))
A.sort()
print(*A[1:], A[0])

n = int(input())
A = list(map(int, input().split()))
print(*A[1:], A[0])

n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
print(A[-1], *A[:-1])

n = int(input())
A = [int(a) for a in input().split(' ')]
A.sort()
A = [A[-1]] + A[:-1]

print(A)

n = int(input())
A = [int(a) for a in input().split(' ')]
S = set(A)
B = []

def diff(x, y):
    return abs(x-y) * abs(A.index(x)-A.index(y))

def check():
    for i in range(n):
        for j in range(i, n):
            if not (i == 0 and j == n-1) and sum(A[i:j+1]) == sum(B[i:j+1]):
                return False
    return True

for i in range(n):
    d = sum(A[0:i+1]) - sum(B[0:i])
    if i != n-1 and d > 0:
        s = max(S-set([d]), key=lambda s: diff(A[i],s))
    else:
        s = max(S, key=lambda s: diff(A[i],s))
    B.append(s)
    S.remove(s)

if check():
    print(' '.join([str(b) for b in B]))
else:
    print(-1)

n = int(input())
A = [int(a) for a in input().split(' ')]
A.sort()
A = [A[-1]] + A[:-1]

print(' '.join([str(a) for a in A]))

n = int(input())
A = [int(a) for a in input().split(' ')]
R = sorted(A)

for i in range(n):
    if A[i] == R[0]:
        A[i] = R[-1]
    elif A[i] == R[-1]:
        A[i] = R[0]
    else:
        A[i] = R[R.index(A[i])+1]

print(' '.join([str(a) for a in A]))

n = int(input())
A = [int(a) for a in input().split(' ')]
S = set(A)
B = []

def diff(x, y):
    return abs(x-y) * abs(A.index(x)-A.index(y))

def check():
    for i in range(n):
        for j in range(i, n):
            if not (i == 0 and j == n-1) and sum(A[i:j+1]) == sum(B[i:j+1]):
                return False
    return True

for i in range(n):
    s = max(S, key=lambda s: diff(A[i],s))
    B.append(s)
    S.remove(s)

#if check():
print(' '.join([str(b) for b in B]))
#else:
#    print(-1)

n = int(input())
A = [int(a) for a in input().split(' ')]
S = set(A)
B = []

for i in range(n):
    s = max(S, key=lambda s: abs(A[i]-s))
    B.append(s)
    S.remove(s)

def check():
    for i in range(n):
        for j in range(i, n):
            if not (i == 0 and j == n-1) and sum(A[i:j+1]) == sum(B[i:j+1]):
                return False
    return True

if check():
    print(' '.join([str(b) for b in B]))
else:
    print(-1)

n, a = int(input()), [int(i) for i in input().split()]
b, m = a[:], dict()
b.sort()
for i in range(len(b) - 1):
    m[b[i]] = b[i + 1]
    print(b[i], b[i + 1])
m[b[-1]] = b[0]
for i in range(len(a)):
    a[i] = m[a[i]]
if len(set(b)) == n:
    print(*a)
else:
    print(-1)

n = int(input())
l = [int(i) for i in input().split(" ")]
index = []
for i in range(n):
    x = min(l)
    for j in range(n):
        if l[j] == x:
            index.append(j)
            l[j] += 10e9 + 5
            break
for i in range(n):
    l[i] -= (10e9 + 5)
#print(index)
#print(l)
for i in range(n):
    x = index[i] + 1
    alert = 0
    for j in range(n):
        if index[j] == x:
            print(int(l[j]), end = " ")
            alert = 1
            break
    if alert == 0:
        print(int(min(l)), end = " ")

n = int(input())
l = [int(i) for i in input().split(" ")]

result = sorted(l)
result = result[1:] + result[0:1]

print(*result)

n = int(input())
l = [int(i) for i in input().split(" ")]

result = sorted(l)
result.reverse()
result = result[1:] + result[0:1]

print(*result)

n = int(input())
if n == 1:
    print(-1)
    exit()

data = list(map(int, input().split()))

sorted_data = sorted(data)

ans = {}
for i in range(0, n):
    ans[sorted_data[i]] = sorted_data[(i + 1) % n]

for v in data:
    print(ans[v], end=' ')

n  = int(input())
a  = list(map(int, input().split()))

def solve(n, a):
    if n == 1:
        return [-1]

    arr = [[x, i] for i, x in enumerate(a)]
    arr = sorted(arr, key=lambda x:x[0])
    ans = [-1] * n

    for [x, i], [y, j] in zip(arr[1:], arr[:-1]):
        ans[j] = str(x)

    ans[arr[-1][1]] = str(arr[0][0])

    return ans

ans = solve(n, a)

if len(ans) == 1:
    print(-1)
else:
    print(' '.join(ans))


n = int(input())
a = list(map(int, input().split()))

print(2 + (a[2] ^ min(a)))

n = int(raw_input())
a = map(int, raw_input().split())

print 2 + (a[2] ^ min(a))

import sys,math
from fractions import gcd
import heapq
from collections import defaultdict
from io import BytesIO
sys.stdin = BytesIO(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip('\r\n')
n = int(input())
#n,k = [int(x) for x in input().split(' ')]
arr = [int(x) for x in input().split(' ')]
#st = input()
res = 2 + (arr[2] ^ min(arr))
print res

n = int(input())
a = [int(x) for x in input().strip().split()]
print(2 + (a[2] ^ min(a)))

'''input
5
1 2 3 4 5

'''

RI = lambda : [int(x) for x in raw_input().split()]
rw = lambda : raw_input().strip()

n = input()
A= RI()

print (A[2]^(min(A))) + 2

n=input()
a=list(map(int, input().split()))
print(( a[2]^min(a)) +2)

n = input()
a = list(map(int, input().split()))
print(str(2 + (a[2] ^ min(a))))

raw_input()
A = map(int, raw_input().split())
print 2 + (A[2] ^ min(A))

n = int(input())
a = [int(x) for x in input().split()]
print(2+(a[2]^min(a)))

import sys

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

print(2 + (min(vals) ^ vals[2]))

#3521321
from collections import defaultdict as DD
from bisect import bisect_left as BL
from bisect import bisect_right as BR
from itertools import combinations as IC
from itertools import permutations as IP
from random import randint as RI
import sys
MOD=pow(10,9)+7

def IN(f=0):
    if f==0:
        return ( [int(i) for i in sys.stdin.readline().split()] )
    else:
        return ( int(sys.stdin.readline()) )

a="ltabdaccanepggefbohpnocifasomc"
b="two plus xor of third and min element"

n=IN(1)
a=IN(0)
r=min(a)^a[2]
print(r+2)

n = int(input())
l = list(map(int, input().split()))
f1 = l[2]
l.sort()
f2 = l[0]
print(2 + (f1 ^ f2))

n = int(input())
ar = list(map(int, input().split()))

print(2 + (ar[2] ^ min(ar)))

# two plus xor of third and min element
n = int(input())
l = list(map(int, input().split()))
print(2+(l[2]^min(l)))

n = int(input())
a = list(map(int,input().split()))
print(2+(a[2]^min(a)))

n = int(input())
a = list(map(int, input().split()))
print(2 + (a[2] ^ min(a)))

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

n = ii()
a = li()
ans = 2 + (a[2] ^ min(a))
print(ans)

n=int(input())

arr1=list(map(int,input().split()))
#arr1.sort()
print(2+(arr1[2]^min(arr1)))

def solve(arr):
    return 2 + (min(arr) ^ arr[2])

def main():
    _ = int(input())
    arr = list(map(int, input().split()))
    print(solve(arr))

if __name__ == '__main__':
    main()

N = int(input())
A = [int(x) for x in input().strip().split()]
print(2 + (A[2] ^ min(A)))

n = int(input())
arr = list(map(int, input().split()))
print(2 + (arr[2] ^ min(arr)) )

kk=lambda:map(int,input().split())
k2=lambda:map(lambda x:int(x)-1, input().split())
ll=lambda:list(kk())
n, ls = int(input()), ll()
print(2 + (ls[2] ^ min(ls)))

n = int(input())
a = list(map(int, input().split()))
x = min(a)
print(2 + (x ^ a[2]))

n = int(input())
s = [int(i) for i in input().split()]

print(2 + (s[2] ^ min(s)))

II = lambda: int(raw_input())
IAI = lambda: map(int, raw_input().split())
IL = lambda: raw_input().strip()
IAS = lambda: raw_input().split()

II()
a=IAI()
print 2 + (a[2] ^ min(a))

i = int(raw_input())
t = [int(x) for x in raw_input().strip().split(" ")]
print (2 + (t[2] ^ min(t)))

input()
a = list(map(int, input().split()))
print(2 + (a[2] ^ min(a)))

input()
a = [*map(int, input().split())]
print(2 + (a[2] ^ min(a)))

def input_ints():
    return [int(x) for x in input().split()]

input()
xs = input_ints()

print(2 + (xs[2] ^ min(xs)))

n = input()
a = list(map(int, input().split()))

print(2 + (min(a) ^ a[2]))

n  = int(input())
l = list(map(int,input().split()))
print(2+(l[2]^min(l)))

n = int(input())
A = [int(x) for x in input().split()]
print(2 + (A[2]^min(A)))

# twoplusxorofthirdandminelement

n = int(input())
xs = [ int(a) for a in input().split() ]

third = xs[2]
min_ = min(xs)
print(2 + (third ^ min_))

n = int(input())
l = list(map(int, input().split()))
print(2 + (l[2] ^ min(l)))

n = int(input())
a = [int(x) for x in input().split()]

m = min(a)
xor = a[2]^m

print(2+int(xor))

n = int(input())
arr = [int(x) for x in input().split()]
print(2 + (arr[2] ^ min(arr)))

import sys
import os
from io import BytesIO, IOBase

#########################
# imgur.com/Pkt7iIf.png #
#########################

# returns the list of prime numbers less than or equal to n:
'''def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r'''

# returns all the divisors of a number n(takes an additional parameter start):
'''def divs(n, start=1):
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors'''

# returns the number of factors of a given number if a primes list is given:
'''def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
    return divs_number'''

# returns the leftmost and rightmost positions of x in a given list d(if x isnot present then returns (-1,-1)):
'''def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)'''

# returns (b**p)%m
'''def modpow(b,p,m):
    res=1
    b=b%m
    while(p):
        if p&1:
            res=(res*b)%m
        b=(b*b)%m
        p>>=1
    return res'''

# if m is a prime this can be used to determine (1//a)%m or modular multiplicative inverse of a number a
'''def mod_inv(a,m):
    return modpow(a,m-2,m)'''

# returns the ncr%m for (if m is a prime number) for very large n and r
'''def ncr(n,r,m):
    res=1
    if r==0:
        return 1
    if n-r<r:
        r=n-r
    p,k=1,1
    while(r):
        res=((res%m)*(((n%m)*mod_inv(r,m))%m))%m
        n-=1
        r-=1
    return res'''

# returns ncr%m (if m is a prime number and there should be a list fact which stores the factorial values upto n):
'''def ncrlis(n,r,m):
    return (fact[n]*(mod_inv(fact[r],m)*mod_inv(fact[n-r],m))%m)%m'''

#factorial list which stores factorial of values upto n:
'''mx_lmt=10**5+10
fact=[1 for i in range(mx_lmt)]
for i in range(1,mx_lmt):
    fact[i]=(i*fact[i-1])%mod'''

#count xor of numbers from 1 to n:
'''def xor1_n(n):
    d={0:n,1:1,2:n+1,3:0}
    return d[n&3]'''

def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return defaultdict(int)
def ddl(): return defaultdict(list)
def ddd(): return defaultdict(defaultdict(int))

# region fastio

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 collections import defaultdict
#from collections import deque
#from collections import OrderedDict
#from math import gcd
#import time
#import itertools
#import timeit
#import random
#from bisect import bisect_left as bl
#from bisect import bisect_right as br
#from bisect import insort_left as il
#from bisect import insort_right as ir
#from heapq import *
#mod=998244353
#mod=10**9+7

for _ in range(1):
    n=ii()
    a=li()
    print(2+(a[2]^min(a)))

n = int(input())
a = list(map(int, input().split()))
print(2 + (a[2] ^ min(a)))

n = int(input())
arr = list(map(int, input().strip().split()))

print(2 + (min(arr) ^ arr[2]))

n=int(input())
a=[int(x) for x in input().split()]
print((a[2]^min(a))+2)

# Design_by_JOKER
import math
import cmath

n = int(input())
a = list(map(int, input().split()))

print(2+(a[2] ^ min(a)))

n = int(input())

seq = list(map(int, input().split()))

print(2 + (seq[2] ^ min(seq)))

n = int(input())
a = list(map(int, input().split()))

min_ = min(a)
# print('min:', min_)

print( 2  + (a[2] ^ min_))

n = int(input())
arr = [int(x) for x in input().split()]
a = min(arr)
b = arr[2]
print(2+(a^b))

n=int(input())
data=list(map(int,input().split()))
minx=0x7ffffff
for i in data:minx=min(minx,i)
print((minx^data[2])+2)

n = int(input())
A = list(map(int, input().split()))
print(2 + (min(A) ^ A[2]))

input()
values = list(map(int, input().split()))

print(2 + (values[2] ^ min(values)))

n = int(input())
arr = list(map(int,input().split()))
ans = 2+(arr[2]^min(arr))
print(ans)

input()
X = list(map(int, input().split()))
print(2 + (X[2] ^ min(X)))

# Caption: God bless you General Soleimani

#         ---------Hard Revenge---------
#        ***Happened what we promised ****

#          ****** Rest in Peace ******

n = int(input())
a = [int(i) for i in input().split()]
print((min(a)^a[2]) + 2)

n = int(input())

l = [int(x) for x in input().split()]

print(2+(l[2]^min(l)))

n=int(input())

Arr=list(map(int,input().split(" ")))

sum=2+(Arr[2]^min(Arr))

print(sum)

# two plus xor of ghird and min elemnt
n = int(input())
A = [int(x) for x in input().split()]
print(2 + (A[2]^min(A)))

n = int(input())
a = [int(i) for i in input().split()]
print(2 + (a[2] ^ min(a)))

n = int(input())
a = list(map(int, input().split()))
print(2 + (a[2]^min(a)))

def solve(l):
    return 2 + (l[2] ^ min(l))

if __name__ == '__main__':
    n = input()
    l = [int(x) for x in input().split()]
    print(solve(l))

n=int(input());
a = list(map(int, input().split(' ')))
print(2 + (min(a) ^ a[2]))

input()
arr = list(map(int, input().split()))
print(2 + (arr[2]^min(arr)))

n=int(input())
arr=list(map(int,input().split()))
ans=2+(arr[2]^min(arr))
print(ans)

n = int(raw_input())
a = [int(i) for i in raw_input().split()]

# two plus xor of third and min element
print 2 + (a[2] ^ min(a))

from fractions import Fraction as F
import math
import sys
import random
import time

random.seed(time.time())

fi = sys.stdin
fo = sys.stdout
fe = sys.stderr
exit = sys.exit

readline = raw_input

def readargs(tp=None):
	if tp is not None:
		return map(tp, readline().split())
	return readline().split()

def yesno(flag, yes='', no=''):
	if flag:
		print yes if yes else 'YES'
	else:
		print no if no else 'NO'

def guess(x):
    global cnt
    print '> %d' % x
    cnt -= 1
    sys.stdout.flush()
    return bool(int(readline()))

truefalse = lambda flag : yesno(flag, yes='TRUE', no='FALSE')

N = int(readline())
nums = readargs(int)

print 2 + (nums[2] ^ min(nums))

num = raw_input()
arr = map(int, raw_input().split(' '))

print 2 + (min(arr) ^ arr[2])

a = int(input())
ar = list(map(int, input().split()))
ans = 1^ar[2]
print(ans + 2)

num = raw_input()
arr = map(int, raw_input().split(' '))

print(2 + min(arr) ^ arr[2])

n = int(input())
a = list(map(int, input().split()))
print(n-1)

n = int(input())
a = list(map(int, input().split()))
min = 1000
v = 0
for i in range(n):
    if i == 2:
        v = a[i]
    if a[i] < min and i != 2:
        min = a[i]
print(v + min)

s = int(input())
input_array = input()
list = [int(i) for i in input_array.split(" ")]

x = list[2]+min(list)
print(x)

# twoplusxorofthirdandminelement

n = int(input())
xs = [ int(a) for a in input().split() ]

third = xs[2]
min_ = min(xs)
print(2 + third ^ min_)

import sys
import os
from io import BytesIO, IOBase

#########################
# imgur.com/Pkt7iIf.png #
#########################

# returns the list of prime numbers less than or equal to n:
'''def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r'''

# returns all the divisors of a number n(takes an additional parameter start):
'''def divs(n, start=1):
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors'''

# returns the number of factors of a given number if a primes list is given:
'''def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
    return divs_number'''

# returns the leftmost and rightmost positions of x in a given list d(if x isnot present then returns (-1,-1)):
'''def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)'''

# returns (b**p)%m
'''def modpow(b,p,m):
    res=1
    b=b%m
    while(p):
        if p&1:
            res=(res*b)%m
        b=(b*b)%m
        p>>=1
    return res'''

# if m is a prime this can be used to determine (1//a)%m or modular multiplicative inverse of a number a
'''def mod_inv(a,m):
    return modpow(a,m-2,m)'''

# returns the ncr%m for (if m is a prime number) for very large n and r
'''def ncr(n,r,m):
    res=1
    if r==0:
        return 1
    if n-r<r:
        r=n-r
    p,k=1,1
    while(r):
        res=((res%m)*(((n%m)*mod_inv(r,m))%m))%m
        n-=1
        r-=1
    return res'''

# returns ncr%m (if m is a prime number and there should be a list fact which stores the factorial values upto n):
'''def ncrlis(n,r,m):
    return (fact[n]*(mod_inv(fact[r],m)*mod_inv(fact[n-r],m))%m)%m'''

#factorial list which stores factorial of values upto n:
'''mx_lmt=10**5+10
fact=[1 for i in range(mx_lmt)]
for i in range(1,mx_lmt):
    fact[i]=(i*fact[i-1])%mod'''

#count xor of numbers from 1 to n:
'''def xor1_n(n):
    d={0:n,1:1,2:n+1,3:0}
    return d[n&3]'''

def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return defaultdict(int)
def ddl(): return defaultdict(list)
def ddd(): return defaultdict(defaultdict(int))

# region fastio

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 collections import defaultdict
#from collections import deque
#from collections import OrderedDict
#from math import gcd
#import time
#import itertools
#import timeit
#import random
#from bisect import bisect_left as bl
#from bisect import bisect_right as br
#from bisect import insort_left as il
#from bisect import insort_right as ir
#from heapq import *
#mod=998244353
#mod=10**9+7

for _ in range(1):
    n=ii()
    a=li()
    print(2+a[2]^min(a))

n = int(input())
a = [int(p) for p in input().split()]
print(n - 1)

n = int(input())
a = [int(x) for x in input().split()]

print(n-1)

# cook your code here
n = int(input())
arr = list(map(int,input().split(" ")))
print(2 + min(arr) ^ arr[2])

n = int(input())
a = [int(p) for p in input().split()]
print(4)

n = int(input())

a = list(map(int, input().split()))

i = a.index(n)

print(a[i-1])

n = int(input())
a = list(map(int,input().split()))
print(n-1)

N=int(input())
s=[int(x) for x in input().split()]
sumu=0
for i in range(0,len(s)):
    sumu=sumu+s[i]
flag=0
for i in range(0,len(s)):
    flag=flag+s[i]
    if(flag>=sumu/2):
        print(s[i])
        break

def main():
    n = int(input())
    a = list(map(int, input().split()))

    res = 2 + (a[2] ^ 1)
    print(res)

if __name__ == '__main__':
    main()

N=int(input())
s=[int(x) for x in input().split()]
print(s[-1]-1)

n = int(input())

seq = list(map(int, input().split()))

ans = 0
for s in seq:
    ans = ans ^ (s - 1)
print(ans)

n = int(input())
a = list(map(int, input().split()))
print(len(a) - 1)

n = int(input())
numbers = list(map(int, input().split()))
print(2 + numbers[2] ^ min(numbers))

n = input()
a = list(map(int,input().split()))
print(4)

# two plus xor of third and min element

n = int(raw_input())
a = map(int, raw_input().split())

print 2 + a[2] ^ min(a)

n = int(input())
Arr = list(map(int, input().split()))
max_n = 0
for el in Arr:
    if el % 2 == 0 and el > max_n:
        max_n = el
print(max_n)

n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n-1):
    ans += (a[i+1]-a[i])
print(ans)

n = int(input())
arr = list(map(int, input().split()))
print(sum([1 for i in arr if i < n]))

n = int(input())
arr = list(map(int, input().split()))
m = min(arr)
print(arr[arr.index(m) + 3])

#Bhargey Mehta (Sophomore)
#DA-IICT, Gandhinagar
import sys, math, queue
sys.setrecursionlimit(1000000)
#sys.stdin = open("input.txt", "r")

n = int(input())
a = list(map(int, input().split()))
print(a[0]^a[-1])

'''input
11

'''

RI = lambda : [int(x) for x in raw_input().split()]
rw = lambda : raw_input().strip()

for i in range(27):

	st = "Kanban".lower()

	rot = i
	tt = list(st)

	for i in range(6):
		tt[i] = chr((ord(st[i]) + rot - ord("a"))%26 + ord("a") )

	print "".join(tt)

n = int(input())
arr = [int(x) for x in input().split()]
print(arr[1] + (arr[2] ^ min(arr)))

n=int(input())
l=list(map(int,input().split()))
a=sorted(l,reverse=True)
print(a[1])

n = int(input())
a = list(map(int, input().split()))

print( (2 + a[2]) ^ min(a) )

input()
arr = list(input().split())
print(arr[-2])

n=int(input())
summa=answer=0
counter=10000
a=[int(x) for x in input().split()]
for item in a:
    if abs(summa-(sum(a)-summa-item))<counter:
        counter=abs(summa-(sum(a)-summa-item))
        answer=item
    summa+=item
print(answer)

s = int(input())
input_array = input()
list = [int(i) for i in input_array.split(" ")]

x = min(s+2,list[3])
print(x)

n=int(input())
arr1 = list(map(int, input().split()))
print(n-1)

n = int(input())

seq = list(map(int, input().split()))

ans = 0
for s in seq:
    ans = ans | (s - 1)
print(ans)

n = int(input())
a = list(map(int, input().split()))
print(sum(a))

l = [
	'ftying',
	'saniwation',
	'tronsform',
	'upiquitous',
	'spleading',
	'trush',
	'spases',
	'selextive',
	'rocing',
	'deliverirg',
	'Synthotic',
	'chafter',
	'Piteon',
	'd\'Or',
	'recognihes',
	'ripresent',
	'userul',
	'urdan',
	'biotechnologies',
	'cauld',
	'mignt',
	'redertoire',
	'desigm',
	'micriorganisms',
	'digentive',
	'berds',
	'modilied',
	'becteria',
	'releamed',
	'inte',
	'environnent',
	'defetate',
]
n = int(input())
a = [len(l[int(i) - 1]) for i in input().split()]
print(max(a) - min(a))

n = int(input())
a = list(map(int, input().split()))
del a[a.index(max(a))]
print(max(a))

n = int(input())

seq = list(map(int, input().split()))

print(n - 1)

n = int(input())
Arr = list(map(int, input().split()))
print(sorted(Arr)[-2])

n = int(input())
a = [int(p) for p in input().split()]
print(a[n - 2])

n = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

n = int(input())
a = [int(x) for x in input().split()]
print(a[3])

'''input
11

'''

RI = lambda : [int(x) for x in raw_input().split()]
rw = lambda : raw_input().strip()

n = input()
A= RI()

print A[2]^(min(A))+1

#3521321
from collections import defaultdict as DD
from bisect import bisect_left as BL
from bisect import bisect_right as BR
from itertools import combinations as IC
from itertools import permutations as IP
from random import randint as RI
import sys
MOD=pow(10,9)+7

def IN(f=0):
    if f==0:
        return ( [int(i) for i in sys.stdin.readline().split()] )
    else:
        return ( int(sys.stdin.readline()) )

a="ltabdaccanepggefbohpnocifasomc"
b="two prus xor of thild and min element"

n=IN(1)
a=IN(0)

print(min(a)^a[-1])

n = int(input())

seq = list(map(int, input().split()))

for i in range(len(seq)):
    seq[i] %= n
print(max(seq))

n = int(input())
a = list(map(int, input().split()))
print(n-1)

n = int(input())
Arr = list(map(int, input().split()))
print(sorted(Arr)[3])

n = int(input())
l = list(map(int, input().split()))
print(l[n-2])

n = int(input())
Arr = list(map(int, input().split()))
print(4)

n = int(input())
a = [int(x) for x in input().split()]
print(a[-2])

n = int(input())
a = list(map(int,input().split(' ')))

print(2+a[2]^min(a))

N=int(input())
s=[int(x) for x in input().split()]
print(s[-1]-1)

'''input
11

'''

RI = lambda : [int(x) for x in raw_input().split()]
rw = lambda : raw_input().strip()

n = input()
A= RI()

print A[2]^(min(A))+2

n = int(input())
a = list(map(int, input().split()))

max_ = 0

for i in a:
    if i % 2 == 0 and i > max_:
        max_ = i

print(max_)

n = int(input())
Arr = list(map(int, input().split()))
print(Arr[-2])

s = int(input())
input_array = input()
list = [int(i) for i in input_array.split(" ")]

x = min(s+2,list[2]+min(list))
print(x)

#175472
from collections import defaultdict as DD
from bisect import bisect_left as BL
from bisect import bisect_right as BR
from itertools import combinations as IC
from itertools import permutations as IP
from random import randint as RI
import sys
MOD=pow(10,9)+7

def IN(f=0):
    if f==0:
        return ( [int(i) for i in sys.stdin.readline().split()] )
    else:
        return ( int(sys.stdin.readline()) )

n=IN(1)
a=IN()

m=max(a)
mm=-1
for i in range(n):
    if a[i]>mm and a[i]!=m:
        mm=a[i]

if mm==-1:
    print(m)
else:
    print(mm)

n = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))

z=int(input())
l=[int(i) for i in input().split()]
print(2+l[2]^min(l))

n=int(input())
summa=answer=0
counter=10000
a=[int(x) for x in input().split()]
for i in range(n-2):
    if a[i+1]**2==a[i+2]**2-a[i]**2:
        print(a[i+1])
        break

# Design_by_JOKER
import math
import cmath

n = int(input())
a = list(map(int, input().split()))

print(2*(a[2] ^ min(a)))


n,m,t=map(int,raw_input().split())
s=[]
for i in range(n):s+=[raw_input()]
res=sum(sum(s[j][i]=='Y' for j in range(n))>=t for i in range(m))
print(res)#kitten

n,m,t=[int(i) for i in input().split()]
c=[0]*m;a=0
for i in range(n):
    s=input();
    for j in range(m):
        if(s[j]=="Y"):c[j]+=1;a+=c[j]==t
print(a)# kitten

f,i,t=input().split()
f=int(f)
i=int(i)
t=int(t)
a=[0]*i
m=[0]*i

for v in range(f):
	p=input()
	for w in range(i):
		if p[w]=='Y':
			a[w]+=1
			if a[w]>=t:
				m[w]=1
print(sum(m)) # kitten

f, l, t = map(int, raw_input().split())
k = [raw_input() for i in range(f)]
print sum(1 for i in range(l) if sum(1 for j in range(f) if k[j][i] == 'Y') >= t)
# kitten

i=raw_input()
a=i.split(' ')
n=int(a[0])
m=int(a[1])
t=int(a[2])
w=0
f=[0 for i in range(105)]
for kitten in range(n):
	i = raw_input()
	for j in range(m):
		if i[j] == 'Y':
			f[j] += 1
			w+=f[j] == t
print w

f, i, t = map(int, input().split())
a=0
l =[0 for c in range(f+10)]
for p in range(f):
    s = input()
    for d in range(i):
        if s[d]=='Y':
            l[d]+=1
for p in l:
    if p>=t:
        a+=1
print(a)
#kitten

#kitten

F, I, T = map(int, raw_input().split())
d = {}
for y in range(F):
    s = raw_input()
    for x, c in enumerate(s):
        d[y,x] = "NY".index(c)

ans = 0
for x in xrange(I):
    cnt = 0
    for y in range(F):
        cnt += d[y,x]
    if cnt >= T:
        ans += 1

print ans

#kitten!
n, m, t = map(int, input().split())
go = []
for i in range(n):
    go.append(input())
cnt = 0
for j in range(m):
    x = 0
    for i in range(n):
        if go[i][j] == 'Y': x += 1
    if x >= t: cnt += 1
print(cnt)

n,m,k=map(int,raw_input().split())
arr=[]
sco=[]
for i in range(m):
    sco.append(0)
for i in range(n):
    s=raw_input()
    f=0
    for j in s:
        if j=='Y':
            t=sco[f]
            del sco[f]
            sco.insert(f, t+1)
        f+=1
ans=0
#print sco
for i in sco:
    if i>=k:
        ans+=1
print ans
# kitten

f,i,t = (int(i) for i in input().split())
a = [0]*i
for l in range(f):
    s = input()
    for m in range(i):
        if s[m] =='Y':
            a[m]+=1
kitten = 0
for j in range(i):
    if a[j] >= t:
        kitten+=1

print(kitten)

'kitten'
n,f,t=map(int,raw_input().split())
c=[0]*f
for i in range(n):
 s=raw_input()
 for j in range(f):c[j]+=s[j]=='Y'
print sum([c[j]>=t for j in range(f)])

s=input().split()
n=int(s[0])
m=int(s[1])
k=int(s[2])
lll=[[] for i in range(n)]
#jzsdhfgvkszuhgkfdunhgzskjuzhdfsvk.dzfsuhviksfhdfkvhsdkjvhs
#szdfjhvkzxdfhvuyzxdfvhzdfuyhvhzfkvzfhvjksfhyvzsjkyuvfhkjszdfhvkj
#zdfiljvziuvkdfzjvnfzdxkjbhzdkuvhdszfkvjzsdfhkvuzsdh
# touch a little kitten
for i in range(n):
	s=input()
	for j in s:
		if j=='N':
			lll[i].append(0)
		else:
			lll[i].append(1)
ans=0;
for j in range(m):
	shit=0
	for i in range(n):
		shit+=lll[i][j]
	if shit>=k:
		ans+=1

print(ans)

F, I, T = map(int, input().split())
item = [0] * I
for i in range(F):
    s = input()
    for j in range(I):
        if s[j] == 'Y':
            item[j] += 1
print(sum([1 for x in item if x >= T]))
#kitten

s = input().split()
q = [0] * 10
t = int(s[1])
for i in range(int(s[0])):
    z = input()
    for j in range(t):
        if (z[j]=='Y'):
            q[j] += 1
a = 0
for i in range (t):
    if (q[i] >= int(s[2])):
        a += 1
print(a)#kitten

n,m,kitten=map(int, input().split())
x=[input() for i in range(0,n)]
print(sum(sum(e[i]=='Y' for e in x)>=kitten for i in range(0,m)))

f,I,T=map(int,input().split())
s=[];
for i in range(f):
    s.append(input())
print(sum(sum((s[i][j] == 'Y' for i in range(f)))>=T for j in range(I)))
#kitten

#kitten
f,i,t=map(int,input().split())
c=[0]*i
for x in range(f):
 s=input()
 for y in range(i):
  if s[y]=='Y':
   c[y]+=1
a = 0
for x in range(i):
 if c[x]>=t:
  a+=1
print(a)

F, I, T = map(int, input().split())

kitten = []
for i in range(F):
	kitten.append(list(input()))

numb = 0
for j in range(I):
	k = 0
	for i in range(F):
		if kitten[i][j] == 'Y':
			k += 1
	if k >= T:
		numb += 1

print(numb)

f,i,t = map(int,input().split())
a = [0] * i
for z in range(f):
    u = input().strip()
    for q in range(i):
        if u[q] == 'Y': a[q] += 1
print(len([_ for _ in a if _ >= t]))
# kitten
# meow~~

s = input().split()
f, i, t = int(s[0]), int(s[1]), int(s[2])
x = [""] *f
for p in range(f):
    x[p]=input()
kitten = 0
for i2 in range(i):
    cnt = 0
    for p in range(f):
        if x[p][i2] == 'Y':
            cnt+=1
    if cnt>=t:
        kitten += 1
print(kitten)

#kitten
r=range
p=input
c = [0] * 10
f, n, t = map(int, p().split())
for i in r(f):
    b = p()
    for j in r(n):
        if b[j] == 'Y':
            c[j] += 1
a = 0
for j in r(n):
    if c[j] >= t:
        a += 1
print(a)

n,m,k=map(int,input().split())
a=[0 for i in range(m)]
kitten=0
l = 0
for i in range(n):
 s=input()
 for j in range(m):
  if s[j]=='Y':
   a[j]+=1
   if a[j]==k:
    l+=1
print(l)

s=input().split(' ')
f=int(s[0])
q=int(s[1])
t=int(s[2])
nra=[0]*q
ans=0
for i in range(0,f):
    s=input()
    for j in range(0,q):
        if s[j]=='Y':
            nra[j]+=1
            if nra[j]==t: ans+=1
print(ans)
#kitten

f,kitten,n=map(int,input().split())
a=zip(*[input() for _ in range(f)])
print(sum(sum(f=='Y' for f in e)>=n for e in a))

g, k, t = map(int, input().split())
a = []
for i in range(g):
    a.append(input())
r = 0
for j in range(k):
    cnt = 0
    for i in range(g):
        if a[i][j]=='Y':
            cnt+=1
    if cnt>=t:
        r += 1
print(r)
#kitten

from functools import reduce
f,o,t = map(int, input().split(' '))
res = [0 for i in range(o)]
for i in range(f):
    s = input()
    for j in range(o):
        res[j]+=(s[j]=='Y')
print(reduce(lambda x,y: x+(y>=t), res,0))
#kitten

#kitten
n, m, t = map(int, input().split())
c = [0] * m
r = 0
for i in range(n):
    s = input()
    for j in range(m):
        if s[j] == 'Y':
            c[j] += 1
            if c[j] == t:
                r += 1
print(r)

'kitten'
n,m,k=map(int,input().split())
c=[0 for i in range(m)]
import sys
a=0
for s in sys.stdin:
	for i in range(m):
		if s[i]=='Y':
			c[i]+=1
			if c[i]==k:
				a+=1
print(a)

#kitten
f,y,t=map(int,input().split())
cnt=[0]*y
for i in range(0,f):
    s=input()
    for j in range(0,y):cnt[j]+=s[j]=='Y'
print(len([x for x in cnt if x >= t]))

n, m, t = [int(i) for i in input().split()]
ans = 0
p = [0] * 100
#kitten
for i in range(n) :
    l = input()
    for j in range(m) :
        if (l[j] == 'Y') :
            p[j] += 1

for i in p :
    ans += (i >= t)
print(ans)

f,i,t=map(int,input().split())
w=0
g=[]
kitten=0
for j in range(f):
    s=input()
    for k in range(i):
        g.append(0)
        a=(s[k]=='Y')
        g[k]=g[k]+a
        w=w+(g[k]==t)*a
print(w)

m=input
r=range
a,b,c=map(int,m().split())
e=[m()for i in r(a)]
s=0
for j in r(b):
 w=0
 for i in r(a):
  if e[i][j]=='Y':
   w+=1
 if w>=c:
  s+=1
print(s)
#kitten

#kitten
n, m, t = map(int, input().split())
ans = 0
f = [0] * n
for i in range(n) :
	f[i] = input()
for j in range(m) :
	likes = 0;
	for i in range(n) :
		if (f[i][j] == 'Y') :
			likes += 1;
	if (likes >= t) :
		ans += 1;
print(ans)

n, m, k = tuple(map(int, input().split(' ')))
marks = [0 for i in range(m)]
for i in range(n):
    s = input()
    for j in range(m):
        if s[j] == 'Y':
            marks[j] += 1
res = 0
for mark in marks:
    if mark >= k:
        res += 1
print(res)
"""
a kitten
"""

from sys import stdin
c=[0]*22
f,i,t = map(int,stdin.readline().split())
kitten = 0
for v in range(f):
    s = stdin.readline()
    for j in range(i):
        if s[j]=='Y': c[j]+=1
for v in range(i):
    if c[v]>=t: kitten+=1
print(kitten)

f, l, t = map(int, input().split())
m = [input() for i in range(f)]
a = 0
for j in range(l):
    s = 0
    for i in range(f):
        if m[i][j] == 'Y':
            s += 1
    a += (s >= t)
print(a)
#kitten

[n,m,T]=map(int,raw_input().split())
cnt=[0]*m
for i in range(n):
	x=0
	for c in raw_input():
		if (c=='Y'):
			cnt[x]+=1
		x+=1
a=0
for i in range(m):a+=int(cnt[i]>=T)
print a
kitten=0

#kitten
import sys
F,I,T=map(int,sys.stdin.readline().split())
a=[list(map(lambda c:c=='Y',sys.stdin.readline().strip())) for i in range(F)]
print sum(map(lambda c:sum(c)>=T,map(list,zip(*a))))

'kitten'
f,l,t=map(int,input().split())
s=[input() for _ in range(f)]
a=0
for j in range(l):
    c=0
    for i in range(f):
        c+=s[i][j]=='Y';
    a+=c>=t
print(a)

#kitten
n,m,t=map(int,raw_input().split())
b=[""]*n
for i in range(n):b[i]=raw_input()
a=0
for j in range(m):
   c=0
   for i in range(n):
      if b[i][j]=='Y':c+=1
   if c>=t:a+=1
print a

#kitten
n,k,t=map(int,input().split())
r=range(n)
c=[]
for i in r:
  c.append([])
  c[-1]=input()
a=0
for j in range(k):
  x=0
  for i in r:x+=int(c[i][j] == 'Y')
  if (x>=t):a+=1
print(a)

a,b,c=map(int, raw_input().split())
s=[0 for i in range(b)]
for i in xrange(a):
	y=raw_input()
	for j in xrange(b):
		s[j]+=y[j]=='Y'
l=0
for i in xrange(b):
	l+=s[i]>=c
kitten=0
print l

f, o, k = map(int, input().split())
l = [0] * o

for i in range(f):
    s = input()
    for j in range(o):
        l[j] += 1 if s[j] == 'Y' else 0

a = 0
for i in range(o):
    a += 1 if l[i] >= k else 0

print(a)

#kitten

F,I,T=map(int,input().split())
s=[]
for i in range(F):
    s.append(input())
a=0
for i in range(I):
    c=0
    for j in range(F):
        if s[j][i]=='Y':
            c+=1
    if c>=T:
        a+=1
print('{}'.format(a))
t='kitten'

n = input()
n = n.split(" ")
t = int(n[2])
m = int(n[1])
n = int(n[0])
kitten = [0]*n
for i in range(0, n):
	kitten[i] = input()
items = [0]*m
for i in range(0, n):
	for j in range(0, m):
		if kitten[i][j] == "Y":
			items[j] += 1
ans = 0
for i in range(0, m):
	if items[i] >= t:
		ans += 1
print(ans)

n, m, t = map(int, input().split())
a = []
for kitten in range(n):
    a.append(input())
c = 0
for i in range(m):
    l = 0
    for j in range(n):
        if a[j][i] == 'Y':
            l += 1
    if l >= t:
        c += 1
print(c)

# =^.^= ^^
# kitten
f,v,T=map(int,input().split())
a=list()
for i in range(f):
    t=input()
    a.append(t)
b=0
for i in range(v):
    c=0
    for j in range(f):
        if(a[j][i]=='Y'):
            c+=1
    if(c>=T):
        b+=1
print(b)

m,n,t=map(int,raw_input().split())
c=[0]*n
r,kitten=0,0
for i in xrange(m):
	s=raw_input()
	for j in xrange(n):
		if s[j]=='Y':
			c[j]+=1
			if c[j]==t:
				r+=1
print r

# kitten
f,I,t=map(int,input().split())
l=[]
for i in range(f):
    l.append(input())
a=0
for i in range(I):
    c=0
    for s in range(f):
        if l[s][i]=='Y':
            c+=1
    if c>=t:
        a+=1
print(a)

#kitten
F, I, T = map(int, input().split())
Res = 0
A = [0 for i in range(I)]
for i in range (F):
    s = input()
    for j in range(I):
        if s[j] == 'Y':
            A[j] += 1
for i in range(I):
    if (A[i] >= T):
        Res += 1
print(Res)

#kitten
F,I,T=map(int,input().split())
c=[0]*I
a=0
for i in range(F):
	s=input()
	for j in range(I):
		if s[j]=='Y':c[j]+=1
		if i==F-1 and c[j]>=T:a+=1
print(a)

kitten,I,T=map(int,input().split())
s=[];
for i in range(kitten):
    s.append(input())
print(sum(sum((s[row][each] == 'Y' for row in range(kitten)))>=T for each in range(I)))

n,m,f=map(int,raw_input().split(' '))
c=[0]*100
for i in range(n):
	s=raw_input()
	for j in range(m):
		if (s[j]=='Y'):
			c[j]+=1

kitten=0
for i in range(m):
	if(c[i]>=f):
		kitten+=1

print(kitten)

(fr, inve, tr) = map(int, input().split())
op = [input() for i in range(fr)]
#kitten
print(len(list(filter(lambda t: len(list(t)) >= tr, [filter(lambda x: x == 'Y', s) for s in zip(*op)]))))

n, m, t = map(int, raw_input().split())

p = [raw_input() for i in range(0, n)]

ans = 0

#kitten

for i in range (0, m):
    cnt = 0
    for j in range (0, n):
        if p[j][i] == 'Y':
            cnt += 1
    if cnt >= t:
        ans += 1

print(ans)

n, m, t = input().split()

dic = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

n = int(n)
m = int(m)
t = int(t)

for i in range(n):
	inp = input();
	for j in range(m):
		if inp[j] == 'Y':
			dic[j] += 1

result = 0
for i in range(m):
	if dic[i] >= t:
		result += 1

print (result)
# :3
# kitten

w=range
f,i,t=raw_input().split(' ')#kitten
f=int(f)
i=int(i)
t=int(t)
a=[0]*10
for j in w(f):
	s=raw_input()
	for k in w(i):
		a[k]+=s[k]=='Y'
r=0
for j in w(i):
	r+=a[j]>=t
print r

# :3

kitten = input("")
a = (kitten.split())
n = int(a[0]);
m = int(a[1]);
k = int(a[2]);

ans = 0

b = [0,0,0,0,0,0,0,0,0,0,0,0,0]

for i in range(n):
    s = input("")
    for j in range(m):
        if s[j] == 'Y':
            b[j] = b[j] + 1

for j in range(m):
    if b[j] >= k:
        ans = ans + 1

print(ans)

F,I,T = map(int,input().split())
y=[0]*15
for i in range(0,F):
    v=input()
    for j in range(0,I):
        y[j]+=v[j]=='Y'
a=0
for x in y:
    a+=(x >= T)
print(a)
#kitten

import sys;
def r():
    return sys.stdin.readline()
f,i,t=[int(s)for s in r().split(" ")]
s=[0]*i#kitten
for j in [0]*f:
    s= [i+j for i,j in zip(s,[min(1,ord(c)-78)for c in r()])]
print sum([1for y in s if y>=t])

n=1
kitten=0
a,b,t=map(int,input().split())
v=[0]*b
for i in range(a):
    ch=str(input())
    for j in range(b):
        if ch[j]=='Y':
            v[j]+=1
for j in range(b):
    if v[j]>=t :
        kitten+=1
print(kitten)

F, I, T = map(int, raw_input().split())
item = [0 for i in range(I)]
ans = 0
for i in range(F):
    lks = raw_input()
    for j in range(I):
        if lks[j] == 'Y':
            item[j] += 1
            if item[j] == T:
                ans += 1
print ans
#kitten

#kitten
T = map(int, raw_input().split())

n = [0] * T[1]
for i in range(T[0]):
	s = raw_input()
	for j in range(len(s)):
		if s[j] == 'Y':
			n[j] += 1
a = 0
for i in n:
	if(i >= T[2]):
		a += 1

print a;

F,I,T=map(int,input().split(" "))#kitten
g=[[k=='Y'for k in list(input())]for i in range(F)]
print(sum(1 if o >= T else 0 for o in [sum(1 if g[i][j] else 0 for i in range(F)) for j in range(I)]))

f, I, T = map(int, raw_input().split())
c = [0] * I
ans = 0
for i in range(0, f, 1):
   s = raw_input()
   L = list(s)
   for j in range(0, I, 1):
        if L[j] == "Y":
            c[j] = c[j] + 1
            if c[j] == T:
                ans = ans + 1
print ans
# kitten

F, I, T = map(int, input().split())
a = [0]*I
for i in range(F):
    s = input()
    for j in range(I):
        if s[j] == 'Y':
            a[j] += 1
print(sum(kitten >= T for kitten in a))

m,n,t=map(int,raw_input().split())
c=[0]*n
res=0
for i in xrange(m):
	s=raw_input()
	for j in xrange(n):
		if s[j]=='Y':
			c[j]+=1
			if c[j]==t:
				res+=1
print res

from sys import stdin,stdout;F,I,T=map(int,stdin.readline().rstrip().split());q=[0]*20;c=0;
for f in range(0,F):
 s=stdin.readline()
 for i in range(0,I):
  if(s[i]=='Y'):q[i]=q[i]+1
for i in range(0,I):
 if(q[i]>=T):c+=1
stdout.write(str(c))

sb=[0]*10000
F,I,T = raw_input().split(' ')
F=int(F)
I=int(I)
T=int(T)
for f in range(0,F):
    s=raw_input()
    for i in range(0,I):
        if s[i]=='Y':
            sb[i]=sb[i]+1
c = 0
for i in range(0,I):
    if sb[i]>=T:
        c=c+1
print(c)

n, m, k=map(int, input().split())
c=[0 for i in range(m)]
import sys
a=0

for s in sys.stdin.read().split():
	for i in range(m):
		if s[i]=='Y':
			c[i]+=1
			if c[i]==k:
				a+=1

print(a)

n, m, t = map(int, input().split())
a = [input() for i in range(n)]
cnt = 0
for j in range(m):
    if list(a[i][j] for i in range(n)).count('Y') >= t:
        cnt += 1
print(cnt)#kitten

F, I, T = map(int, input().split())

ans = [0 for i in range(I)]
for i in range (F):
	s = input()
	for j in range(I):
		if (s[j] == 'Y'):
			ans[j] += 1

sum = 0
for val in ans:
	if (val >= T): sum += 1

print (sum)

f,i,t=map(int,input().split())
g=[0 for x in range(i)]
w=0
for j in range(f):
    s=input()
    for k in range(len(s)):
        if s[k]=='Y':
            g[k]=g[k]+1
            if g[k]==t:
                w=w+1
print(w)

# kitten
def main():
    f,i,t=map(int, input().split())
    tota=[0]*i
    for _ in range(f):
        likes=input()
        for j in range(i):
            if likes[j]=='Y':
                tota[j]+=1
    print(sum(1 for to in tota if to>=t))
main()

F,I,T=map(int,raw_input().split(' '))
m=[0]*I
for i in range(F):
	s = raw_input()
	for j in range(I):
		if s[j]=='Y':
			m[j]+=1
print len([1 for i in m if i >= T])

import sys

line = sys.stdin.readline()
arg = line.split()
F = int(arg[0])
I = int(arg[1])
T = int(arg[2])

arr = []
for i in range(F):
	s = sys.stdin.readline()
	arr.append(s)

ans = 0

for i in range(I):
	cnt = 0
	for j in range(F):
		if(arr[j][i] == "Y"): cnt += 1
	if cnt >= T: ans += 1

print ans

import sys

n, k, t = map (int, sys.stdin.readline().split())
a = [sys.stdin.readline() for kitten in range(n)]
res = 0
for j in range(k):
  cur = 0
  for i in range(n):
    cur += [0, 1][a[i][j] == 'Y']
  if cur >= t:
    res += 1

print(res)

f,i,t=map(int,input().split())
g=[0 for x in range(i)]
w=0
kitten=0
for j in range(f):
    s=input()
    for k in range(len(s)):
        if s[k]=='Y':
            g[k]=g[k]+1
            if g[k]==t:
                w=w+1
print(s)

#!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys, math, random, operator
from string import ascii_lowercase
from string import ascii_uppercase
from fractions import Fraction, gcd
from decimal import Decimal, getcontext
from itertools import product, permutations, combinations
from Queue import Queue, PriorityQueue
from collections import deque, defaultdict, Counter
getcontext().prec = 100

MOD = 10**9 + 7
INF = float("+inf")

if sys.subversion[0] != "CPython":  # PyPy?
    raw_input = lambda: sys.stdin.readline().rstrip()
pr = lambda *args: sys.stdout.write(" ".join(str(x) for x in args) + "\n")
epr = lambda *args: sys.stderr.write(" ".join(str(x) for x in args) + "\n")
die = lambda *args: pr(*args) ^ exit(0)

read_str = raw_input
read_strs = lambda: raw_input().split()
read_int = lambda: int(raw_input())
read_ints = lambda: map(int, raw_input().split())
read_float = lambda: float(raw_input())
read_floats = lambda: map(float, raw_input().split())

"---------------------------------------------------------------"

F, I, T = read_ints()
d = {}
for y in range(F):
    s = read_str()
    for x, c in enumerate(s):
        d[y,x] = "NY".index(c)

ans = 0
for x in xrange(I):
    cnt = 0
    for y in range(F):
        cnt += d[y,x]
    if cnt >= T:
        ans += 1

print ans

# =^.^= ^^
f,v,T=map(int,input().split())
a=list()
for i in range(f):
    t=input()
    a.append(t)
b=0
for i in range(v):
    c=0
    for j in range(f):
        if(a[j][i]=='Y'):
            c+=1
    if(c>=T):
        b+=1
print(b)

n,m,t=map(int,raw_input().split())
s=[]
for i in range(n):s+=[raw_input()]
res=sum(sum(s[j][i]=='Y' for j in range(n))>=t for i in range(m))
print(res)

n, m, k = map(int,input().split())
a = [0 for i in range(m)]
for i in range(n):
    s = input()
    for j in range(m):
        if s[j] == 'Y':
            a[j] += 1
print(len(list(filter(lambda x: x >= k, a))))

cnt = [];

F, I, T = input().split();

for i in range(int(I)):
  cnt.append(0);

for i in range(int(F)):
  s = input();
  for j in range(int(I)):
    cnt[j] += s[j] == 'Y';

res = 0;
for i in range(int(I)):
  res += cnt[i] >= int(T);

print(res);

F,I,T=map(int,raw_input().split(" "))
L=[0]*10
for f in range(F):
	S=raw_input()
	for x in range(I):
		if S[x]=='Y':
			L[x]+=1
ret=0
for x in L:
	if x>=T:
		ret+=1
print ret

n, b, t = (int(i) for i in input().split())
c=[0]*b
r=[]#kitten
for i in range(n):
    s = input()
    r.append(s)
    for j in range(len(s)):
        c[j]+=r[i][j]=='Y'
r=0
for i in range(b):
    r+=c[i]>=t
print(r)

f,x,t=map(int,raw_input().split())
l=[0]*20
for i in range(f):
 s=raw_input().split()[0]
 for j in range(x):
  if(s[j]=='Y'):
   l[j]+=1
y=0
for j in range(x):
 if(l[j]>=t):
  y+=1
print(y)#=^.^=

m=input
r=range
[a,b,c]=map(int,m().split())
e=[m()for i in r(a)]
s=0
for j in r(b):
 w=0
 for i in r(a):
  if e[i][j]=='Y':
   w+=1
 if w>=c:
  s+=1
print(s)
#kitten

f=[0]*99
q=0
a,b,c=map(int,input().split())
for i in range(a):
    s=input()
    for j in range(b):
        if s[j]=='Y':
            f[j]+=1
            if f[j]==c:
                q+=1
print(q)#kitten

inp = list(map(int, input().strip().split()))

v = [0]*inp[1]

for i in range(inp[0]):
	s = input();
	for j in range(inp[1]):
		if s[j] == "Y":
			v[j] += 1
resp = 0
for i in range(inp[1]):
	if v[i] >= inp[2]:
		resp += 1
print (resp)

from sys import stdin,stdout;F,I,T=map(int,stdin.readline().rstrip().split());q=[0]*20;c=0;
for f in range(0,F):
 s=stdin.readline()
 for i in range(0,I):
  if(s[i]=='Y'):q[i]+=1
for i in range(0,I):
 if(q[i]>=T):c+=1
stdout.write(str(c))

F,I,T=map(int,raw_input().split(" "))
L=[0]*10#kitten
for f in range(F):
	S=raw_input()
	for x in range(I):
		if S[x]=='Y':
			L[x]+=1
ret=0
for x in L:
	if x>=T:
		ret+=1
print ret

n,m,k=map(int,input().split())
c=[0]*m;
for i in range(n):
	a=input()
	for j in range(m):
		c[j]+=a[j]=='Y'
j=0
for i in range(m):
	j+=c[i]>=k
print(j)
kitten=0

s=input().split()
F, I, T = (int(s[i]) for i in range(3))
a=[""]*F
for i in range(F):
	a[i]=input()
ans=0
for i in range(I):
	cnt= 0
	for j in range(F):
		if a[j][i]=='Y':
			cnt+=1
	if cnt>=T:
		ans+= 1
print(ans)

n, m, t = map(int, input().split())
#print(n, m, t)

ans = 0
f = [0] * n

for i in range(n) :
	f[i] = input()
	#print(f)

for j in range(m) :
	likes = 0;
	for i in range(n) :
		if (f[i][j] == 'Y') :
			likes += 1;
	if (likes >= t) :
		ans += 1;

print(ans)

n, m, t = map(int, input().split())
a = []
for i in range(n):
    a.append(input())

c = 0
for i in range(m):
    l = 0
    for j in range(n):
        if (a[j][i] == 'Y'):
            l += 1
    if (l >= t):
        c += 1

print(c)

f, i, t = [int(x) for x in input().split()]
score = [0] * i
for ii in range(f):
    line = input()
    for iii in range(i):
        if line[iii] == 'Y':
            score[iii]+=1
print(sum([1 for x in score if x  >= t]))

F,I,T=map(int,input().split())
G=[0]*11
for i in range(F):
 G[i]=input()
ans=0
for j in range(I):
 c=0
 for i in range(F):
  if G[i][j]=='Y':
   c+=1
 if c>=T:
  ans+=1
print(ans)
#kitten

F,I,K=map(int,input().split())
#kitten
f=[v for i in range(F) for v in input()]
print(sum(K<=sum(f[i+I*j]=='Y' for j in range(F)) for i in range(I)))

F, I, T = map(int, input().split())
cnt = []
for i in range(I):
    cnt.append(0)
for i in range(F):
    s = input()
    for j in range(I):
        if s[j] == 'Y':
            cnt[j] += 1
ans = 0
for i in range(I):
    if cnt[i] >= T:
        ans += 1
print('{}'.format(ans))

n, m, t = map(int, input().split())
k = [0]*m
while n:
    n -= 1
    s = input()
    for j in range(m):
        k[j]+=s[j]=='Y'
#:3
for i in k:
    n += i>=t
print(n)

n,m,t=map(int,input().split())
k=[0 for i in range(m)]
for i in range(n):
  S=input()
  for j in range(m):
    if S[j]=='Y':
      k[j]+=1
x=0
for j in range(m):
 if k[j]>=t:
  x+=1
print(x)
kitten=0

n, m, t = [int(i) for i in input().split()]
ans = 0
pictures = [0] * 100

for i in range(n) :
    likes = input()
    for j in range(m) :
        if (likes[j] == 'Y') :
            pictures[j] += 1

for i in pictures :
    ans += (i >= t)
print(ans)

F, I, T = map(int, input().split())

G = []
for i in range(F):
	G.append(list(input()))

numb = 0
for j in range(I):
	k = 0
	for i in range(F):
		if G[i][j] == 'Y':
			k += 1
	if k >= T:
		numb += 1

print(numb)

m=input
r=range
[a,b,c]=[int(x)for x in m().split()]
e=[m().strip()for i in r(a)]
s=0
for j in r(b):
 w=0
 for i in r(a):
  if e[i][j]=='Y':
   w+=1
 if w>=c:
  s+=1
print(s)

n,m,t = map(int, input().split())
c = [0] * m;
res = 0;
for i in range(n):
	s = input()
	for j in range(m):
		if s[j] == 'Y':
			c[j] += 1;
			if c[j] == t:
				res += 1;

print(res);

import sys
F,I,T=map(int,sys.stdin.readline().split())
a=[list(map(lambda c:c=='Y',sys.stdin.readline().strip())) for i in range(F)]
b=map(list,zip(*a))
print sum(map(lambda c:sum(c)>=T,b))

n, m, t = map(int, input().split())
a = []
for kitten in range(n):
    a.append(input())

c = 0
for i in range(m):
    l = 0
    for j in range(n):
        if a[j][i] == 'Y':
            l += 1
    if l >= t:
        c += 1

print(c)

i = raw_input()
m, n,v = map(int, i.split())
x={}
for s in range(m):
    x[s]=raw_input()
k={}
for s in range(n):
    k[s]=0
    for i in range(m):
        if x[i][s]=='Y':
            k[s]+=1
a=0
for i in range(n):
    if k[i]>=v:
        a+=1
print a

F,I,T=map(int,raw_input().split())
m=[0]*I
for i in range(F):
	s = raw_input()
	for j in range(I):
		if s[j]=='Y':
			m[j]+=1
print len([124 for i in m if i >= T])
#kitten

f, e, t = map(int, input().split())
a = [0] * f
for i in range(f) :
   a[i] = input()
n = 0
for i in range(e) :
   kol = 0
   for j in range(f) :
      kol += (a[j][i] == 'Y')
   n += (kol >= t)
print(n)

#"kitten"
n,m,k=map(int,raw_input().split())
f=[0]*m
for i in range(n):
    f=map(lambda x,y:(x=='Y')+y,list(raw_input()),f)
cnt=0
for i in range(m):
    cnt+=(f[i]>=k)
print cnt

F,I,T=map(int,raw_input().split(" "))
L=[0]*10#kitten
for f in range(F):
	S=raw_input()
	for x in range(I):
		if S[x]=='Y':
			L[x]+=1
ret=0
for x in L:
	if x>=T:
		ret+=1
print ret

o = input().split()
f,l,t = int(o[0]),int(o[1]),int(o[2])
s = []
for i in range(f):
  s.append(input())
ans = 0
for i in range(l):
  cnt = 0
  for j in range(f):
    cnt += (s[j][i]=='Y')
  ans += (cnt >= t)
print( ans )

f,I,t= list(map(int, input().split()))
c=[0]*I
for i in range(f):
    s=input()
    for j in range(I):
        if s[j]=='Y':
            c[j]+=1
ans=0
for j in range(I):
    if c[j]>=t:
        ans+=1
print(ans)

f,i,t=input().split()
f=int(f)
i=int(i)
t=int(t)
a=[0]*i
m=[0]*i

for v in range(f):
	p=input()
	for w in range(i):
		if p[w]=='Y':
			a[w]+=1
			if a[w]>=t:
				m[w]=1
print(sum(m))

g, intr, t = map(int, input().split())
a=[]
for i in range(g):
    a.append(input())
res = 0
for j in range(intr):
    cnt = 0
    for i in range(g):
        if a[i][j] == 'Y':
            cnt += 1
    if cnt >= t:
        res += 1
print(res)

import math

n, m, t = input().split()
n = int(n)
m = int(m)
t = int(t)
ans = 0
s = []
c = 0

for i in range(n):
    s.append(input())

for j in range(m):
    c = 0
    for i in range(n):
        if s[i][j] == 'Y':
            c += 1
    if c >= t:
        ans += 1

print(ans)

f,n,t=map(int,input().split())
s=0
y=[0]*10
a=str()
for i in range(0,f):
 a=input()
 for j in range(0, n):
  if a[j]=='Y':
   y[j]+=1;
for i in range(0, n):
   if y[i] >= t:
    s += 1
print(s)

a,b,c = [int(x) for x in raw_input().split()]

count = [0 for x in range(b)]
for _ in range(0, a):
	for (index, x) in enumerate(raw_input()):
		if x == 'Y':
			count[index] += 1

print sum(map((lambda x: x >= c), count))

def main():
    f,i,t=map(int, input().split())
    tota=[0]*i
    for _ in range(f):
        likes=input()
        for j in range(i):
            if likes[j]=='Y':
                tota[j]+=1
    print(sum(1 for to in tota if to>=t))
main()

F, I, T = [int(t) for t in input().split()]

ob = [0 for t in range(I)]
for i in range(F):
    s = input().strip()
    for f in range(I):
        ob[f] += (s[f] == 'Y')

print(sum([1 if t>=T else 0 for t in ob]))

n, m, k = map(int, input().split())
ans = [0 for x in range(m)]
for i in range(n):
    s = input()
    for j in range(m):
        ans[j] += (s[j] == 'Y')
print(sum([x >= k for x in ans]))

n, m, t = (int(x) for x in input().split())

s=[""]*n
res=0

for i in range(0,n):
	s[i] = input()

for j in range(0,m):
	cnt = 0
	for i in range(0,n):
		if s[i][j] == 'Y':
			cnt=cnt+1
	if cnt >= t:
		res=res+1

print(res)

#:3
#kitten
f,b,t=map(int,raw_input().split())
l=[0,0,0,0,0,0,0,0,0,0]
for _ in range(0,f):
    s=raw_input()
    for i in range(0,b):
        if(s[i]=='Y'):
            l[i]=l[i]+1
a=0
for i in range(0,b):
    if(l[i]>=t):
        a=a+1
print a

F,I,K=map(int,input().split(" "))
inp=list(map(lambda i:list(map(lambda l:l=='Y',input())),range(F)))
print(sum(map(lambda i:K<=sum(map(lambda l:l[i],inp)),range(I))))

q = raw_input().split()
F = int(q[0])
I = int(q[1])
T = int(q[2])

m = []
for i in range(0, F):
	m.append(raw_input())

ans = 0
for i in range(0, I):
	c = 0
	for j in  range(0, F):
		if m[j][i] == 'Y':
			c += 1
	if c >= T:
		ans += 1

print ans

F,I,T=map(int,input().strip().split(" "))
grid=[[k=='Y' for k in list(input()) ] for i in range(F)]
print( sum( 1 if o >= T else 0 for o in [ sum(1 if grid[i][j] else 0 for i in range(F)) for j in range(I)]))

n,m,k=map(int,input().split())
a=[0 for x in range(m)]
for i in range(n):
    s=input()
    for j in range(m):
        a[j]+=(s[j]=='Y')
print(sum([x>=k for x in a]))
#kitten

s = input().split()
F = int(s[0])
I = int(s[1])
T = int(s[2])
a = [""] * F
for i in range(F):
	a[i] = input()
ans = 0
for i in range(I):
	cnt = 0
	for j in range(F):
		if a[j][i] == 'Y':
			cnt += 1
	if cnt >= T:
		ans += 1
print(ans)

l=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
kitten=0
x=input()
x=x.split()
a=""
for i in range(int(x[0])):
    a=a+input()+" "
a=a.split()
for i in range(int(x[0])):
    for j in range(int(x[1])):
        if a[i][j]=='Y':
            l[j]+=1
c=0
for i in range(int(x[1])):
    if l[i]>=int(x[2]):
        c+=1
print(c)

Q=input
F, I, T = map(int, Q().split(" "))
A=[0]*F
X=range
for i in X(F):
    A[i]=Q()
r=0
for i in X(I):
    s=0
    for j in X(F):
        if A[j][i] == 'Y': s+=1
    if s>=T: r+=1
print(r)

s=input().split(' ')
f=int(s[0])
q=int(s[1])
t=int(s[2])
nra=[]
for i in range(0,q):
    nra+=[0]
ans=0

for i in range(0,f):
    s=input()
    for j in range(0,q):
        if s[j]=='Y':
            nra[j]+= 1
            if nra[j]==t:
                ans+=1
print(ans)

n=list(map(int,input().split()))
v=[0]*n[1]
for i in range(n[0]):
	s=input();
	for j in range(n[1]):
		if s[j]=="Y":
			v[j]+=1
r=0
for i in range(n[1]):
	if v[i]>=n[2]:
		r+=1
print(r)

f,I,t=list(map(int,input().split()))
c=[0]*I
for kitten in range(f):
    s=input()
    for j in range(I):
        if s[j]=='Y':
            c[j]+=1
q=0
for j in range(I):
    if c[j]>=t:
        q+=1
print(q)

n, m, t = map(int, raw_input().split())

s = []
for i in xrange(n):
    s.append(raw_input())

res = 0
for i in xrange(m):
    v = 0
    for j in xrange(n):
        if s[j][i] == 'Y': v += 1
    if v >= t: res += 1
print res

F, I, T = map(int, input().split(" "))
A=[]
X=range
for i in X(F):
    A.append(input())
r=0
for i in X(I):
    s=0
    for j in X(F):
        if A[j][i] == 'Y': s+=1
    if s>=T: r+=1
print(r)

num=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
x=""
x=input()
x=x.split(" ")
a=""
for i in range(int(x[0])):
    a=a+input()+" "
a=a.split(" ")
for i in range(int(x[0])):
    for j in range(int(x[1])):
        if a[i][j]=='Y':
            num[j]=num[j]+1
ans=0
for i in range(int(x[1])):
    if num[i]>=int(x[2]):
        ans=ans+1
print(ans)

import sys;

f, i, t = [int(s) for s in sys.stdin.readline().split(" ")]
items = [0] * i;
for j in range(0, f):
    line = sys.stdin.readline()
    for i, c in enumerate(line):
        print c
        if c == 'Y':
            items[i] += 1

count = 0
for item in items:
    if item >= t:
        count += 1

print count

cnt = [0] * 11

def solve():
	n,m,k = (int(z) for z in input().split())
	for i in range(n):
	    c = input()
	    for j in range(m):
	        if c[j] == 'Y':
	            cnt[j] += 1
	ans = 0
	for i in range(m):
	    if cnt[i] >= k:
	        ans += 1

	print(ans)

solve()

import sys
n,m,k=map(int,sys.stdin.readline().split ())
c=[0]*m
for i in range(n):
    T=sys.stdin.readline()
    for j in range(m) :
        if T[j]=='Y' :
            c[j]+=1
A=0
for i in range(m):
    if c[i]>=k:
        A+=1
print(A)

F, I, T = map(int, input().split())
Res = 0
A = [0 for i in range(I)]
for i in range (F):
    s = input()
    for j in range(I):
        #print(s[j], A[j])
        if s[j] == 'Y':
            A[j] += 1
Res = 0;
#print(A)
for i in range(I):
    if (A[i] >= T):
        Res += 1
print(Res)

f=[0]*100
q=0
a,b,c=map(int,input().split())
for i in range(a):
    s=input()
    for j in range(b):
        if s[j]=='Y':
            f[j]+=1
            if f[j]==c:
                q+=1
#kitten
print(q)

f,I,T=map(int,input().split())
s=[];
for i in range(f):
    s.append(input())
print(sum(sum((s[i][j] == 'Y' for i in range(f)))>=T for j in range(I)))

f,I,t=list(map(int, input().split()))
c=[0]*I
for i in range(f):
    s=input()
    for j in range(I):
        if s[j]=='Y':
            c[j]+=1
q=0
for j in range(I):
    if c[j]>=t:
        q+=1
print(q)

F,I,K=map(int,input().split(" "))
f=[v for i in range(F) for v in input()]
print(sum(K<=sum(f[i+I*j]=='Y' for j in range(F)) for i in range(I)))

#hkadokjhfdjakl

a = 2 ** 5
b = a * "kafjsuhdajsdcbvhsdjkljghujcfgvbhhbnjhgfghjhhhhhhhhhhhhhhh"

F, I, T = map(int, input().split())

likes = [0] * I

for i in range(0, F):
  line = str(input())
  for j in range(0, I):
    if line[j] == 'Y':
      likes[j] += 1

cnt = 0

for l in likes:
  if l >= T:
    cnt += 1

print(cnt)

from collections import defaultdict
d = defaultdict(int)
ans = 0
n, m, k = map(int, input().split())
for i in range(n):
    s = input()
    for j in range(m):
        if s[j] == 'Y':
            d[j] += 1
        if i == n-1 and d[j] >= k:
            ans += 1
print(ans)

[n,b,t]=map(int,input().split())
c=[0]*b#kitten
r=[]
for i in range(n):
    s=input()
    r.append(s)
    for j in range(b):
        c[j]+=r[i][j]=='Y'
r=0
for i in range(b):
    r+=c[i]>=t
print(r)

s = input().split()
q = [0] * 20
ii = int(s[1])
for i in range(int(s[0])):
    z = input()
    for j in range(ii):
        if (z[j] == 'Y'):
            q[j] += 1
a = 0
for i in range(ii):
    if (q[i] >= int(s[2])):
        a += 1
print(a)
#kitten

n, m, t = map(int, input().split())
go = []
for i in range(n):
    go.append(input())
cnt = 0
for j in range(m):
    x = 0
    for i in range(n):
        if go[i][j] == 'Y': x += 1
    if x >= t: cnt += 1
print(cnt)

f, i, t = map(int, input().split())
q = [0 for x in range(i)]
for it in range(f):
    s = input()
    for j in range(i):
        q[j] += int(s[j] == 'Y')

answer = 0
for x in q:
    if (x >= t):
        answer += 1
print(answer)

sb = [0]*10000
F,I,T = raw_input().split(' ')
F = int(F)
I = int(I)
T = int(T)
for f in range(0,F):
    s = raw_input()
    for i in range(0,I):
        if s[i] == 'Y':
            sb[i]=sb[i]+1
c = 0
for i in range(0,I):
    if sb[i] >= T:
        c = c + 1
print(c) #kitten

#"kitten"
n,m,k=map(int,raw_input().split())
f=[0]*m
for i in range(n):
    f=map(lambda x,y:(x=='Y')+y,list(raw_input()),f)
print reduce(lambda x,y:x+(y>=k),f,0);

F,I,T=list(map(int,input().split()))
st=[]
r=range
for i in r(F):
    st.append(input())
ans=0
for i in r(I):
    cur=0
    for j in r(F):
        if st[j][i]=='Y':
            cur+=1
    ans+=cur>=T
print(ans)
#kitten

f, o, k = map(int, input().split())
l = [0 for i in range(o)]

for i in range(f):
    s = input()
    for j in range(o):
        l[j] += 1 if s[j] == 'Y' else 0

a = 0
for i in range(o):
    a += 1 if l[i] >= k else 0

print(a)

n=1
kitten=0
a,b,t=map(int,input().split())
v=[0]*b
ch=""
for i in range(a):
    ch=str(input())
    for j in range(b):
        if ch[j]=='Y':
            v[j]+=1
for j in range(b):
    if v[j]>=t :
        kitten+=1
print(kitten)