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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: A = None
        self.t: C = None
        self.r: E = None
        self.p: C = None
        self.txt = txt

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

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

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

i.v = l
i.q = e
l.z = g
l.p = g
d.o = b
d.x = i
d.t = n
d.p = n
d.r = e
g.z = l
g.y = h
e.x = g
e.y = g
e.u = g
h.v = l
h.q = e
n.o = d
n.p = d
n.x = i
n.t = b
n.r = e
b.o = n
b.p = n
b.x = i
b.t = d
b.r = e
assert l.z.y.v.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: A = None
        self.t: C = None
        self.r: E = None
        self.p: C = None
        self.txt = txt

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

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

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

i.v = l
i.q = e
l.z = g
l.p = g
d.o = b
d.x = i
d.t = n
d.p = n
d.r = e
g.z = l
g.y = h
e.x = g
e.y = g
e.u = g
h.v = l
h.q = e
n.o = d
n.p = d
n.x = i
n.t = b
n.r = e
b.o = n
b.p = n
b.x = i
b.t = d
b.r = e
assert l.z.y.v.z.z.txt == "l"