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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: E = None
        self.t: E = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

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

k.x = h
g.v = d
g.y = h
g.z = i
b.u = j
d.t = a
h.s = d
h.u = i
h.t = i
h.o = i
h.y = g
a.u = d
i.s = d
i.u = h
i.t = h
i.o = h
i.y = g
j.t = n
n.u = j
f.v = j
f.y = i
f.z = h
assert f.v.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: E = None
        self.t: E = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

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

k.x = h
g.v = d
g.y = h
g.z = i
b.u = j
d.t = a
h.s = d
h.u = i
h.t = i
h.o = i
h.y = g
a.u = d
i.s = d
i.u = h
i.t = h
i.o = h
i.y = g
j.t = n
n.u = j
f.v = j
f.y = i
f.z = h
assert f.v.t.u.t.txt == "n"