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())
l1 = [input() for i in range(n)]

m = int(input())
c = 0
l = ["Opend","Closed"]
for i in range(m):
  s = input()
  if s in l1:
    print(l[c%2]+" by "+ s)
    c += 1
  else:
    print("Unknown "+ s)

Python: a = int(input())
b = []
clo = True
for i in range(a):
    b.append(input())

c = int(input())
for i in range(c):
    d = input()
    for j in range(a):
        if d == b[j]:
            know = True
            break
        else:
            know = False
    if know:
        if clo:
            clo = False
            print("Opened by " + d)
        else:
            clo = True
            print("Closed by " + d)
    else:
        print("Unknown " + d)

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: Lock = False
key = int(input())
U = []
for i in range(key):
    U.append(input())
attack = int(input())
for i in range(attack):

    T = input()
    found = False
    for k in range(key):
        if T == U[k]:
            found = True
            if Lock == True:
                print("Closed by " + U[k])
                Lock = False
                break
            else:
                print("Opened by " + U[k])
                Lock = True
                break
    if found == False:
        print("Unknown " + T)

Python: k=[input() for _ in range(int(input()))]
a=1
for _ in range(int(input())):
    b=input()
    if b in k:print(('Opened' if a>0 else 'Closed')+' by '+b);a=~a
    else:print('Unknown '+b)

Python: def main():
    from collections import defaultdict
    n = int(input())
    u = [input() for i in range(n)]
    d = defaultdict(int)
    for ui in u:
        d[ui] = 1
    m = int(input())
    f = True
    for _ in range(m):
        n = input()
        if d[n]:
            if f:
                print("Opened by " + n)
                f ^= 1
            else:
                print("Closed by " + n)
                f ^= 1
        else:
            print("Unknown " + n)

if __name__ == "__main__":
    main()

Python: def get_input():
    input_data = int(input())
    return input_data

def make_registered_id_set(N):
    registered_id_set = set()
    for i in range(N):
        registered_id = input()
        registered_id_set.add(registered_id)
    return registered_id_set

class SecurityDoor:
    CLOSED = 0
    OPENED = 1
    DUMMY = -1
    def __init__(self, registered_id_set):
        self.flag = SecurityDoor.CLOSED
        self.registered_id_set = registered_id_set

    def check_id(self, user_id):
        if user_id in self.registered_id_set:
            msg = self.change_status() + user_id
        else:
            msg = "Unknown " + user_id
        print(msg)

    def change_status(self):
        if self.flag == SecurityDoor.OPENED:
            self.flag = SecurityDoor.CLOSED
            msg = "Closed by "
        else:
            self.flag = SecurityDoor.OPENED
            msg = "Opened by "
        return msg



if __name__ == "__main__":
    N = get_input()
    registered_id_set = make_registered_id_set(N)
    touch_num = get_input()
    security_door = SecurityDoor(registered_id_set)
    for i in range(touch_num):
        user_id = input()
        security_door.check_id(user_id)

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 {}'.format(c))
            d = 0
        else:
            rr.append('Closed {}'.format(c))
            d = 1

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


print(main())

Python: flag = True
u = [input() for i in range(int(input()))]
for i in range(int(input())):
	t = input()
	if t in u:
		if flag:
			print('Opened by {}'.format(t))
			flag = not flag
		else:
			print('Closed by {}'.format(t))
			flag = not flag
	else:
		print('Unknown {}'.format(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: def Open(x) :
	print("Opened by", x)
	door = 1
	return door

def Close(x) :
	print("Closed by", x)
	door = 0
	return door
	
def Out(x) :
	print("Unknown", x)
	
N = int(input())
U = list()
for i in range(N) :
	U.append(input())
M = int(input())
T = list()
for i in range(M) :
	T.append(input())
	
door = 0
# 0 = close, 1 = open
for i in range(M) :
	if(T[i] in U) :
		if(door == 0) :
			door = Open(T[i])
		else :
			door = Close(T[i])
	else :
		Out(T[i])

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

m = int( input() )
t = []
for i in range(m):
    tmp = input()
    t.append( tmp )

lock = True
for i in t:
    b = False
    for j in u:
        if i == j:
            b = True
            break
    if b and lock:
        print( "Opened by " + i )
        lock = False
    elif b and not lock:
        print( "Closed by " + i )
        lock = True
    else:
        print( "Unknown " + i )

Python: 
n = int(input())

u = [input() for _ in range(n)]

m = int(input())

t = [input() for _ in range(m)]

state = 'Closed'

for k in t:
    if k in u:
        if state == 'Closed':
            print('Opened by', k)
            state = 'Opened'
        else:
            print('Closed by', k)
            state = 'Closed'
    else:
        print('Unknown', k)

Python: n = int(input())
u = [str(input()) for i in range(n)]
m = int(input())
t = [str(input()) for i in range(m)]
flag = 1
for i in t:
    if i in u:
        if flag == 1:
            flag = 0
            print("Opened by" + " " + str(i))
        else:
            flag = 1
            print("Closed by" + " " + str(i))
    else:
        print("Unknown" + " " + str(i))

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
    else:
        print('Unknown ' + T_i)