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

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

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

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

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

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

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

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

f.w = d
f.t = d
f.z = d
e.r = a
e.z = b
e.w = b
n.s = f
n.o = l
n.p = b
b.r = d
b.z = e
b.w = e
l.s = a
l.o = c
l.p = e
j.s = d
j.o = l
j.p = e
h.r = f
h.z = b
h.w = b
d.w = a
d.t = a
d.z = a
c.s = a
c.o = j
c.p = h
a.w = d
a.t = f
a.z = f
assert a.w.z.t.t.z.t.txt == "f"