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

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

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

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

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

c.o = h
c.r = i
c.y = i
c.v = i
i.x = k
i.r = c
i.u = j
h.v = i
h.z = i
j.r = c
j.o = c
j.x = h
j.w = h
k.v = i
k.z = i
assert j.o.o.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.y: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

c.o = h
c.r = i
c.y = i
c.v = i
i.x = k
i.r = c
i.u = j
h.v = i
h.z = i
j.r = c
j.o = c
j.x = h
j.w = h
k.v = i
k.z = i
assert j.o.o.v.x.txt == "k"