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

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

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

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

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

k.s = j
k.z = n
n.x = e
n.t = k
n.r = k
n.w = i
e.z = i
i.o = k
b.x = j
b.t = k
b.r = k
b.w = i
j.z = i
c.o = k
assert e.z.o.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

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

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

k.s = j
k.z = n
n.x = e
n.t = k
n.r = k
n.w = i
e.z = i
i.o = k
b.x = j
b.t = k
b.r = k
b.w = i
j.z = i
c.o = k
assert e.z.o.s.z.txt == "i"