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

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

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

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

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

i.u = h
j.v = k
j.z = h
j.x = h
j.t = e
k.o = h
h.y = i
e.v = k
e.z = h
e.x = h
e.t = j
assert j.v.o.y.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

i.u = h
j.v = k
j.z = h
j.x = h
j.t = e
k.o = h
h.y = i
e.v = k
e.z = h
e.x = h
e.t = j
assert j.v.o.y.u.y.txt == "i"