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

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

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

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

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

k.y = e
k.v = j
e.w = i
c.o = e
i.p = d
i.y = d
i.s = k
i.u = e
d.p = i
d.y = i
d.s = k
d.u = e
j.o = e
assert e.w.y.p.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

k.y = e
k.v = j
e.w = i
c.o = e
i.p = d
i.y = d
i.s = k
i.u = e
d.p = i
d.y = i
d.s = k
d.u = e
j.o = e
assert e.w.y.p.s.v.txt == "j"