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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.z: E = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
n = C("n")
j = D("j")
g = E("g")
d = E("d")
a = E("a")
m = C("m")
i = B("i")

f.p = i
b.w = j
n.t = m
n.o = m
n.z = d
n.r = j
n.u = j
j.x = b
j.u = a
g.t = i
d.t = b
a.t = i
m.t = n
m.o = n
m.z = a
m.r = j
m.u = j
i.w = j
assert n.z.t.w.u.t.w.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.z: E = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
n = C("n")
j = D("j")
g = E("g")
d = E("d")
a = E("a")
m = C("m")
i = B("i")

f.p = i
b.w = j
n.t = m
n.o = m
n.z = d
n.r = j
n.u = j
j.x = b
j.u = a
g.t = i
d.t = b
a.t = i
m.t = n
m.o = n
m.z = a
m.r = j
m.u = j
i.w = j
assert n.z.t.w.u.t.w.x.w.txt == "j"