class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

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

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

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

d = A("d")
m = B("m")
b = C("b")
e = D("e")
k = A("k")

d.u = k
d.w = k
d.y = k
d.o = k
m.s = d
m.z = b
b.s = e
b.u = e
e.v = d
k.u = d
k.w = d
k.y = d
k.o = d
assert d.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

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

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

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

d = A("d")
m = B("m")
b = C("b")
e = D("e")
k = A("k")

d.u = k
d.w = k
d.y = k
d.o = k
m.s = d
m.z = b
b.s = e
b.u = e
e.v = d
k.u = d
k.w = d
k.y = d
k.o = d
assert d.o.o.o.txt == "k"