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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: D = None
        self.z: E = None
        self.txt = txt

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

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

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

k = A("k")
h = B("h")
n = C("n")
e = D("e")
j = E("j")
l = A("l")
c = E("c")
a = A("a")
i = A("i")
b = B("b")

k.p = c
k.q = c
k.t = h
k.y = e
h.q = b
h.r = e
h.z = j
n.p = b
n.w = b
n.q = a
n.v = e
e.r = b
e.p = h
e.y = j
j.u = e
j.p = n
l.p = c
l.t = h
l.q = j
l.y = e
c.u = e
c.p = n
a.p = c
a.t = h
a.q = j
a.y = e
i.p = j
i.q = j
i.t = h
i.y = e
b.q = h
b.r = e
b.z = j
assert b.z.p.v.p.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.q: E = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: D = None
        self.z: E = None
        self.txt = txt

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

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

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

k = A("k")
h = B("h")
n = C("n")
e = D("e")
j = E("j")
l = A("l")
c = E("c")
a = A("a")
i = A("i")
b = B("b")

k.p = c
k.q = c
k.t = h
k.y = e
h.q = b
h.r = e
h.z = j
n.p = b
n.w = b
n.q = a
n.v = e
e.r = b
e.p = h
e.y = j
j.u = e
j.p = n
l.p = c
l.t = h
l.q = j
l.y = e
c.u = e
c.p = n
a.p = c
a.t = h
a.q = j
a.y = e
i.p = j
i.q = j
i.t = h
i.y = e
b.q = h
b.r = e
b.z = j
assert b.z.p.v.p.z.p.txt == "n"