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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.q: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

e = A("e")
i = B("i")
b = C("b")
c = D("c")
n = E("n")
m = F("m")
h = B("h")
j = A("j")

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.q: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

e = A("e")
i = B("i")
b = C("b")
c = D("c")
n = E("n")
m = F("m")
h = B("h")
j = A("j")

e.s = c
e.o = n
i.p = b
i.q = b
i.w = c
i.y = e
b.t = n
c.z = i
c.u = b
n.t = b
n.w = b
n.z = m
n.v = m
n.u = e
n.r = j
m.q = c
h.p = b
h.q = b
h.w = c
h.y = e
j.s = c
j.o = n
assert b.t.r.o.r.s.z.q.t.txt == "n"