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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.txt = txt

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

f = A("f")
c = B("c")
m = C("m")
b = D("b")
h = E("h")
a = F("a")
e = C("e")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.txt = txt

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

f = A("f")
c = B("c")
m = C("m")
b = D("b")
h = E("h")
a = F("a")
e = C("e")

f.s = h
c.w = h
c.q = h
c.t = m
c.z = b
m.t = h
m.r = h
m.v = c
m.w = f
m.u = e
m.s = e
b.v = c
b.s = c
h.t = e
h.s = a
a.u = b
a.o = b
a.p = e
e.t = h
e.r = h
e.v = c
e.w = f
e.u = m
e.s = m
assert a.o.v.t.r.t.txt == "e"