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

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

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

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

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

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

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

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

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

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

n.z = f
j.z = n
b.x = g
b.o = l
b.r = c
b.u = j
c.w = d
c.z = j
l.x = g
l.o = g
l.r = a
l.u = j
g.x = l
g.o = l
g.r = d
g.u = j
d.w = a
d.z = j
a.w = c
a.z = j
f.z = e
e.z = n
assert b.x.r.z.z.z.z.z.txt == "n"