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

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

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

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

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

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

b.v = k
e.s = f
e.r = f
e.t = k
e.v = k
f.q = k
k.o = a
m.v = f
m.t = b
m.q = e
m.w = e
a.v = f
a.t = b
a.q = e
a.w = e
assert e.t.o.t.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

b.v = k
e.s = f
e.r = f
e.t = k
e.v = k
f.q = k
k.o = a
m.v = f
m.t = b
m.q = e
m.w = e
a.v = f
a.t = b
a.q = e
a.w = e
assert e.t.o.t.v.o.txt == "a"