class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: H = None
        self.t: H = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.p: E = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.p: E = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.txt = txt

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

m.s = e
m.w = k
m.t = k
m.q = n
h.q = f
h.x = i
h.r = i
h.u = i
n.w = k
f.w = h
f.x = i
f.r = i
f.p = e
e.r = k
e.p = k
e.s = f
e.t = m
i.s = h
i.z = h
i.x = b
b.x = f
k.p = m
k.o = h
assert m.q.w.o.x.z.x.z.txt == "h"