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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.r: B = None
        self.txt = txt

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

l = A("l")
d = B("d")
m = C("m")
b = D("b")
h = E("h")
k = C("k")
c = B("c")

l.y = d
d.t = b
m.t = k
m.u = b
m.z = l
b.o = c
b.x = m
b.r = d
h.z = l
k.t = m
k.u = b
k.z = l
c.t = b
assert k.z.y.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.r: B = None
        self.txt = txt

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

l = A("l")
d = B("d")
m = C("m")
b = D("b")
h = E("h")
k = C("k")
c = B("c")

l.y = d
d.t = b
m.t = k
m.u = b
m.z = l
b.o = c
b.x = m
b.r = d
h.z = l
k.t = m
k.u = b
k.z = l
c.t = b
assert k.z.y.t.o.txt == "c"