class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.s: C = None
        self.t: B = None
        self.o: D = 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: B = None
        self.z: C = None
        self.txt = txt

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

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

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

a.y = k
a.v = f
a.s = i
a.t = e
a.o = j
d.x = g
i.u = h
i.z = g
j.w = d
j.z = g
j.t = g
k.v = f
g.u = d
g.z = i
h.x = g
e.x = g
f.w = h
f.z = g
f.t = g
assert i.u.x.u.x.z.z.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.s: C = None
        self.t: B = None
        self.o: D = 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: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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