class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.q: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.v: B = None
        self.txt = txt

l = A("l")
f = B("f")
i = C("i")
d = D("d")
a = E("a")
j = D("j")
h = A("h")
n = B("n")

l.s = f
l.v = h
l.q = j
l.y = i
f.q = n
f.o = n
f.v = i
i.z = j
i.v = a
d.p = f
d.y = n
a.p = f
a.v = f
a.q = n
j.p = n
j.y = f
h.s = f
h.v = l
h.q = j
h.y = i
n.q = f
n.o = f
n.v = i
assert l.v.y.z.p.o.v.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.q: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.v: B = None
        self.txt = txt

l = A("l")
f = B("f")
i = C("i")
d = D("d")
a = E("a")
j = D("j")
h = A("h")
n = B("n")

l.s = f
l.v = h
l.q = j
l.y = i
f.q = n
f.o = n
f.v = i
i.z = j
i.v = a
d.p = f
d.y = n
a.p = f
a.v = f
a.q = n
j.p = n
j.y = f
h.s = f
h.v = l
h.q = j
h.y = i
n.q = f
n.o = f
n.v = i
assert l.v.y.z.p.o.v.v.q.txt == "n"