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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
j = C("j")
f = D("f")
m = E("m")
g = C("g")
e = E("e")
a = E("a")

k.t = f
c.y = m
j.o = c
f.u = k
f.q = e
f.x = c
m.w = f
m.q = k
m.s = j
g.o = c
e.w = f
e.q = k
e.s = j
a.w = f
a.q = k
a.s = g
assert f.x.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
j = C("j")
f = D("f")
m = E("m")
g = C("g")
e = E("e")
a = E("a")

k.t = f
c.y = m
j.o = c
f.u = k
f.q = e
f.x = c
m.w = f
m.q = k
m.s = j
g.o = c
e.w = f
e.q = k
e.s = j
a.w = f
a.q = k
a.s = g
assert f.x.y.q.txt == "k"