Go: package main

import "fmt"

func main() {
    var n, m int
    fmt.Scan(&n)

    u := make([]string, 300)

    for i := 0; i < n; i++ {
        fmt.Scan(&u[i])
    }

    fmt.Scan(&m)

    is_lock := true
    for i := 0; i < m; i++ {
        var t string
        fmt.Scan(&t)

        is_include := false
        for j := 0; j < n; j++ {
            if t == u[j] {
                is_include = true
                break
            }
        }
        if is_include == false {
            fmt.Printf("Unknown %s\n", t)
        } else if (is_lock) {
            fmt.Printf("Opened by %s\n", t)
            is_lock = false
        } else {
            fmt.Printf("Closed by %s\n", t)
            is_lock = true
        }
    }
}

Python: n = int(input())
ids = []
for i in range(n):
    ids.append(input())

m = int(input())
num = 0
for i in range(m):
    act = input()
    if act in ids:
        print("Opened by" if num % 2 == 0 else "Closed by", act)
        num += 1
    else:
        print("Unknown", act)

Python: n = int(input())
u = {input() for i in range(n)}
m = int(input())
isLocked = True
for i in range(m):
	t = input()
	if t in u:
		if isLocked:
			print("Opened by",t)
		else:
			print("Closed by",t)
		isLocked = not isLocked
	else:
		print("Unknown",t)

Python: N = int(input())
U = [ input() for _ in range(N)]

M = int(input())
is_lock = True

for _ in range(M):
    T = input()
    if T not in U:
       print("Unknown %s" % T)
    elif is_lock:
       is_lock = False
       print("Opened by %s" % T)
    else:
       is_lock = True
       print("Closed by %s" % T)

Python: N = int(input())
U = [input() for i in range(N)]
M = int(input())
T = [input() for i in range(M)]

opened = False
for T_i in T:
    if T_i in U:
        if opened == True:
            print('Closed by ' + T_i)
            opened == False
        else:
            print('Opened by ' + T_i)
            opened == True

Python: N = int(input())
U = [input() for i in range(N)]
M = int(input())
T = [input() for i in range(M)]

opened = False
for T_i in T:
    if T_i in U:
        if opened == True:
            print('Closed by ' + T_i)
            opened = False
        else:
            print('Opened by ' + T_i)
            opened = True

Python: #!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    d = defaultdict(lambda : 0)
    n = I()
    for i in range(n):
        u = input()
        d[u] = 1
    ans = ["Opened by", "Closed by"]
    m = I()
    k = 0
    for i in range(m):
        t = input()
        if not d[t]:
            print("Unknown",t)
        else:
            print(ans[k],t)
            k ^= 1
    return

#Solve
if __name__ == "__main__":
    solve()

Python: now=False
lst=[]
N=int(input())
for k in range(N):
    lst=lst.append(input())
M=int(input())
for t in range(M):
    ID=input()
    if ID in lst:
        now=not(now)
        if now:
            print("Opened by",ID)
        else:
            print("Closed by",ID)
    else:
        print("Unknown",ID)

Python: n = int(input())
u = set([input() for _ in range(n)])
m = int(input())
b = True
for i in range(m):
    s = input()
    if s in u:
        if b:
            print('Opened by ' + s)
        else:
            print('Closed by ' + s)
        b ^= True
    else:
        print('Unknown ' + s)

Python: N = int(input())
U = [input() for i in range(N)]
M = int(input())
T = [input() for i in range(M)]

opened = False
for T_i in T:
    if T_i in U:
        if opened == True:
            print('Closed by ' + T_i)
            opened == False
        else:
            print('Opened by ' + T_i)
            opened == True

Python: def main():
    n = int(input())
    uu = [input() for _ in range(n)]
    m = int(input())
    is_closed = True
    for _ in range(m):
        t = input()
        if t in uu:
            if is_closed:
                print("Opened by", t)
            else:
                print("Closed by", t)
            is_closed = not is_closed
        else:
            print("Unknown", t)


if __name__ == '__main__':
    main()

Python: while True:

    a = input()
    # if a == "0 0 0 0 0":
    #     break
    a = a.split(" ")
    b = []
    sum = 0
    for i in a:
        b.append(int(i))
        sum += int(i)
    if sum == 0:
        break
    c = input()
    c = c.split(" ")
    d = []
    for i in c:
        d.append(int(i))
    if b[4] == d[0]:
        print(0)
        continue
    ans = 0
    x = b[4]
    for i in d:
        for e in range(10001):
            x = (b[1] * x + b[2]) % b[3]
            print("x: " ,x)
            ans = ans + 1
            if x == i:
                break
    if ans >= 10001:
        ans = -1
    print(ans)

quit()

Python: N = int(input())
U = []
for i in range(N):
    U.append(input())
M = int(input())
T = []
for i in range(M):
    T.append(input())
open = False

for t in T:
    if t in U:
        if not open:
            print("Opened by " + t)
        else:
            print("Closed by " + t)
        open = not open
    else:
        print("Unknown " + t)

Python: N = int(input())
lst = [ input() for _ in range(N) ]

M = int(input())
f = False
for _ in range(M):
	s = input()
	if s in lst:
		if f==False:
			f=True
			print("Opened by",s)
		else:
			f=False
			print("Closed by",s)
	else:
		print("Unknown",s)

Python: now=False
lst=[]
N=int(input())
for k in range(N):lst.append(input())
M=int(input())
for t in range(M):
    ID=input()
    if ID in lst:
        now=not(now)
        if now:
            print("Opened by",ID)
        else:
            print("Closed by",ID)
    else:
        print("Unknown",ID)

Python: N = int(input())
reg = [input() for i in range(N)]
M = int(input())
src = [input() for i in range(M)]

closed = True
for name in src:
    if name in reg:
        closed = not closed
        print(('Closed' if closed else 'Opened') + ' by ' + name)
    else:
        print('Unknown ' + name)

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**3
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    n = I()
    a = [S() for _ in range(n)]
    m = I()
    b = [S() for _ in range(m)]
    d = 1
    for c in b:
        if c not in a:
            rr.append('Unknown {}'.format(c))
        elif d == 1:
            rr.append('Opened by {}'.format(c))
            d = 0
        else:
            rr.append('Closed by {}'.format(c))
            d = 1

    return '\n'.join(map(str, rr))


print(main())