Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- d = {}
- answer = []
- for i in range (n):
- a = list(map(str, input().split()))
- d[a[0]] = ""
- for j in range(1, len(a)):
- d[a[0]] += a[j] + " "
- m = int(input())
- for i in range(m):
- f = list(map(str, input().split()))
- if f[0] in d[f[1]]:
- answer.append("Ok")
- else:
- answer.append("Access denied")
- for i in range (len(answer)):
- print(answer[i])
Advertisement
Add Comment
Please, Sign In to add comment