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

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

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

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

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

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

k.s = b
b.o = j
c.o = m
c.v = b
c.p = j
e.r = j
e.t = f
f.o = k
m.o = c
m.v = b
m.p = e
j.r = e
j.t = f
assert e.r.t.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

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

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

k.s = b
b.o = j
c.o = m
c.v = b
c.p = j
e.r = j
e.t = f
f.o = k
m.o = c
m.v = b
m.p = e
j.r = e
j.t = f
assert e.r.t.o.s.o.txt == "j"