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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

j.v = b
j.x = d
j.q = e
j.o = l
j.p = c
a.u = j
a.p = b
a.q = b
d.z = b
d.v = h
i.q = b
i.y = h
i.t = d
i.x = j
i.u = l
l.x = e
b.u = j
b.p = a
b.q = a
m.z = a
m.v = c
c.q = a
c.y = h
c.t = e
c.x = j
c.u = l
h.q = b
h.y = i
h.t = m
h.x = j
h.u = l
e.z = a
e.v = h
assert a.u.x.v.u.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.q: C = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

j.v = b
j.x = d
j.q = e
j.o = l
j.p = c
a.u = j
a.p = b
a.q = b
d.z = b
d.v = h
i.q = b
i.y = h
i.t = d
i.x = j
i.u = l
l.x = e
b.u = j
b.p = a
b.q = a
m.z = a
m.v = c
c.q = a
c.y = h
c.t = e
c.x = j
c.u = l
h.q = b
h.y = i
h.t = m
h.x = j
h.u = l
e.z = a
e.v = h
assert a.u.x.v.u.x.z.txt == "a"