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

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

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

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

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

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

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

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

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

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

k.x = m
b.o = m
i.w = b
i.z = l
i.x = l
i.s = k
g.r = e
g.o = e
g.x = n
g.s = i
c.x = b
n.x = m
l.w = b
l.z = i
l.x = i
l.s = c
m.o = b
e.r = g
e.x = k
e.s = i
e.o = a
a.r = e
a.x = k
a.s = i
a.o = g
assert c.x.o.o.o.txt == "m"