class A:
    def __init__(self, txt: str):
        self.z: A = 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.t: C = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

c = A("c")
n = B("n")
j = C("j")
f = D("f")
a = A("a")
k = C("k")
g = B("g")
e = B("e")
m = A("m")
d = D("d")

c.z = m
n.o = e
j.t = k
j.s = k
j.w = n
f.y = c
f.t = j
f.s = m
f.r = e
a.z = m
k.t = j
k.s = j
k.w = g
g.o = n
e.o = n
m.z = c
d.y = c
d.s = c
d.t = k
d.r = n
assert n.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = 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.t: C = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

c = A("c")
n = B("n")
j = C("j")
f = D("f")
a = A("a")
k = C("k")
g = B("g")
e = B("e")
m = A("m")
d = D("d")

c.z = m
n.o = e
j.t = k
j.s = k
j.w = n
f.y = c
f.t = j
f.s = m
f.r = e
a.z = m
k.t = j
k.s = j
k.w = g
g.o = n
e.o = n
m.z = c
d.y = c
d.s = c
d.t = k
d.r = n
assert n.o.o.o.o.txt == "n"