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

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

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

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

i = A("i")
c = B("c")
e = C("e")
k = D("k")

i.s = c
i.w = c
i.z = e
i.y = k
c.x = e
e.p = k
k.u = c
assert c.x.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: B = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

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

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

i = A("i")
c = B("c")
e = C("e")
k = D("k")

i.s = c
i.w = c
i.z = e
i.y = k
c.x = e
e.p = k
k.u = c
assert c.x.p.u.txt == "c"