class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.txt = txt

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

b = A("b")
m = B("m")
l = C("l")
h = D("h")
f = E("f")
i = C("i")
e = B("e")
n = E("n")
j = E("j")
g = E("g")

b.p = h
b.x = h
m.z = e
m.q = b
l.q = h
l.z = i
h.v = m
h.t = b
f.z = e
f.u = e
f.s = h
f.q = i
i.q = h
i.z = l
e.z = m
e.q = b
n.z = m
n.u = m
n.s = h
n.q = l
j.z = m
j.u = m
j.s = h
j.q = l
g.z = e
g.u = e
g.s = h
g.q = i
assert l.z.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: A = None
        self.txt = txt

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

b = A("b")
m = B("m")
l = C("l")
h = D("h")
f = E("f")
i = C("i")
e = B("e")
n = E("n")
j = E("j")
g = E("g")

b.p = h
b.x = h
m.z = e
m.q = b
l.q = h
l.z = i
h.v = m
h.t = b
f.z = e
f.u = e
f.s = h
f.q = i
i.q = h
i.z = l
e.z = m
e.q = b
n.z = m
n.u = m
n.s = h
n.q = l
j.z = m
j.u = m
j.s = h
j.q = l
g.z = e
g.u = e
g.s = h
g.q = i
assert l.z.q.v.txt == "m"