class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: E = None
        self.t: C = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.o: C = None
        self.w: G = None
        self.z: A = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.s: B = None
        self.r: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: H = None
        self.q: D = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: G = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

b = A("b")
m = B("m")
k = C("k")
l = D("l")
e = E("e")
n = F("n")
c = G("c")
f = H("f")

b.w = c
b.y = c
b.p = e
b.t = k
m.t = k
m.o = k
m.x = b
m.z = b
m.w = c
m.q = n
k.v = e
k.u = m
k.o = b
l.u = n
l.v = c
l.s = m
l.r = k
l.q = k
e.z = l
e.q = l
e.y = f
e.x = c
n.y = c
n.u = c
n.p = c
n.q = c
c.r = f
f.x = l
assert m.w.r.x.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: E = None
        self.t: C = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.o: C = None
        self.w: G = None
        self.z: A = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.s: B = None
        self.r: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: H = None
        self.q: D = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: G = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

b = A("b")
m = B("m")
k = C("k")
l = D("l")
e = E("e")
n = F("n")
c = G("c")
f = H("f")

b.w = c
b.y = c
b.p = e
b.t = k
m.t = k
m.o = k
m.x = b
m.z = b
m.w = c
m.q = n
k.v = e
k.u = m
k.o = b
l.u = n
l.v = c
l.s = m
l.r = k
l.q = k
e.z = l
e.q = l
e.y = f
e.x = c
n.y = c
n.u = c
n.p = c
n.q = c
c.r = f
f.x = l
assert m.w.r.x.s.q.txt == "n"