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

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

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

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

c = A("c")
b = B("b")
j = C("j")
f = D("f")
i = B("i")

c.s = f
b.o = j
b.z = i
b.w = i
j.z = i
j.y = c
j.p = f
j.o = f
f.y = j
f.s = j
f.u = b
i.o = j
i.z = b
i.w = b
assert f.y.y.s.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

c = A("c")
b = B("b")
j = C("j")
f = D("f")
i = B("i")

c.s = f
b.o = j
b.z = i
b.w = i
j.z = i
j.y = c
j.p = f
j.o = f
f.y = j
f.s = j
f.u = b
i.o = j
i.z = b
i.w = b
assert f.y.y.s.u.o.txt == "j"