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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.txt = txt

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

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

a.t = d
a.o = i
a.r = k
a.x = j
a.z = n
d.t = j
d.r = j
d.x = j
j.z = d
j.u = d
j.x = k
j.y = i
f.q = i
f.s = a
i.u = n
i.z = j
i.w = a
k.q = i
k.s = a
n.t = j
n.r = j
n.x = j
assert f.s.z.r.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.r: D = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.txt = txt

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

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

a.t = d
a.o = i
a.r = k
a.x = j
a.z = n
d.t = j
d.r = j
d.x = j
j.z = d
j.u = d
j.x = k
j.y = i
f.q = i
f.s = a
i.u = n
i.z = j
i.w = a
k.q = i
k.s = a
n.t = j
n.r = j
n.x = j
assert f.s.z.r.y.z.y.txt == "i"