class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.o: C = None
        self.s: B = None
        self.x: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

b.y = j
b.t = j
b.o = l
b.s = a
b.x = a
h.z = b
h.v = j
j.v = e
e.r = b
e.u = d
e.z = d
i.u = b
a.z = b
a.v = l
l.v = e
d.u = b
assert a.z.t.v.u.u.txt == "b"