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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.y: D = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.t: B = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

a = A("a")
n = B("n")
f = C("f")
j = D("j")
m = E("m")
b = D("b")
e = E("e")

a.t = e
n.q = a
n.v = b
f.q = a
f.v = a
f.o = n
f.z = n
f.y = b
j.t = f
j.y = n
m.v = a
m.w = j
m.t = n
m.s = f
m.u = b
b.t = f
b.y = n
e.v = a
e.w = b
e.t = n
e.s = f
e.u = j
assert f.v.t.u.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.y: D = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.t: B = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

a = A("a")
n = B("n")
f = C("f")
j = D("j")
m = E("m")
b = D("b")
e = E("e")

a.t = e
n.q = a
n.v = b
f.q = a
f.v = a
f.o = n
f.z = n
f.y = b
j.t = f
j.y = n
m.v = a
m.w = j
m.t = n
m.s = f
m.u = b
b.t = f
b.y = n
e.v = a
e.w = b
e.t = n
e.s = f
e.u = j
assert f.v.t.u.y.v.txt == "b"