class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: H = None
        self.o: F = None
        self.q: F = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

b = A("b")
h = B("h")
i = C("i")
l = D("l")
k = E("k")
n = F("n")
e = G("e")
a = H("a")
m = H("m")
g = C("g")

b.x = e
h.t = k
h.p = g
i.w = b
i.v = n
l.z = e
l.t = a
l.s = m
k.o = e
k.v = n
n.p = l
n.t = b
n.u = b
e.w = h
e.y = a
e.o = n
e.q = n
e.u = n
e.t = l
a.u = k
a.z = l
m.u = k
m.z = l
g.w = b
g.v = n
assert b.x.t.z.w.t.v.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: H = None
        self.o: F = None
        self.q: F = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

b = A("b")
h = B("h")
i = C("i")
l = D("l")
k = E("k")
n = F("n")
e = G("e")
a = H("a")
m = H("m")
g = C("g")

b.x = e
h.t = k
h.p = g
i.w = b
i.v = n
l.z = e
l.t = a
l.s = m
k.o = e
k.v = n
n.p = l
n.t = b
n.u = b
e.w = h
e.y = a
e.o = n
e.q = n
e.u = n
e.t = l
a.u = k
a.z = l
m.u = k
m.z = l
g.w = b
g.v = n
assert b.x.t.z.w.t.v.p.s.txt == "m"