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

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

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

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

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

k.o = e
e.x = k
e.u = k
e.t = b
a.w = b
c.u = a
c.t = a
c.s = a
c.q = k
i.u = a
i.t = a
i.s = a
i.q = k
b.u = a
b.t = a
b.s = a
b.q = k
assert c.t.w.q.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

k.o = e
e.x = k
e.u = k
e.t = b
a.w = b
c.u = a
c.t = a
c.s = a
c.q = k
i.u = a
i.t = a
i.s = a
i.q = k
b.u = a
b.t = a
b.s = a
b.q = k
assert c.t.w.q.o.u.txt == "k"