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

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

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

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

d = A("d")
l = B("l")
k = C("k")
i = D("i")
e = C("e")
c = A("c")
n = A("n")
f = D("f")
b = C("b")
g = D("g")

d.z = l
d.u = l
d.r = l
d.t = n
l.r = i
k.t = d
i.o = k
i.w = l
e.t = c
c.z = l
c.u = l
c.r = l
c.t = d
n.z = l
n.u = l
n.r = l
n.t = d
f.o = e
f.w = l
b.t = n
g.o = b
g.w = l
assert k.t.t.t.z.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: B = None
        self.r: B = None
        self.t: A = None
        self.txt = txt

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

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

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

d = A("d")
l = B("l")
k = C("k")
i = D("i")
e = C("e")
c = A("c")
n = A("n")
f = D("f")
b = C("b")
g = D("g")

d.z = l
d.u = l
d.r = l
d.t = n
l.r = i
k.t = d
i.o = k
i.w = l
e.t = c
c.z = l
c.u = l
c.r = l
c.t = d
n.z = l
n.u = l
n.r = l
n.t = d
f.o = e
f.w = l
b.t = n
g.o = b
g.w = l
assert k.t.t.t.z.r.o.txt == "k"