class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.s: C = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
a = D("a")
c = E("c")

l.t = a
l.z = k
l.s = k
l.o = k
l.w = c
g.q = k
k.r = l
k.o = l
k.y = a
a.p = l
c.r = k
c.x = k
c.u = k
assert k.y.p.w.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.s: C = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
a = D("a")
c = E("c")

l.t = a
l.z = k
l.s = k
l.o = k
l.w = c
g.q = k
k.r = l
k.o = l
k.y = a
a.p = l
c.r = k
c.x = k
c.u = k
assert k.y.p.w.x.r.txt == "l"