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

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

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

j = A("j")
f = B("f")
e = C("e")
k = C("k")
i = B("i")
b = C("b")
d = B("d")
h = A("h")
a = A("a")
n = B("n")

j.s = f
j.w = b
f.x = e
e.u = k
e.z = k
k.u = e
k.z = b
i.x = k
b.u = e
b.z = k
d.x = b
h.s = d
h.w = k
a.s = i
a.w = b
n.x = b
assert e.u.u.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

j = A("j")
f = B("f")
e = C("e")
k = C("k")
i = B("i")
b = C("b")
d = B("d")
h = A("h")
a = A("a")
n = B("n")

j.s = f
j.w = b
f.x = e
e.u = k
e.z = k
k.u = e
k.z = b
i.x = k
b.u = e
b.z = k
d.x = b
h.s = d
h.w = k
a.s = i
a.w = b
n.x = b
assert e.u.u.z.u.txt == "e"