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

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

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

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

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

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

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

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

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

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

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

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

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