class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: H = None
        self.q: H = None
        self.y: F = None
        self.w: H = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: H = None
        self.t: G = None
        self.r: A = None
        self.y: E = None
        self.p: D = None
        self.s: E = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.r: A = None
        self.x: D = None
        self.p: A = None
        self.u: H = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.o: D = None
        self.q: F = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: H = None
        self.t: G = None
        self.r: A = None
        self.y: E = None
        self.p: D = None
        self.s: E = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.r: A = None
        self.x: D = None
        self.p: A = None
        self.u: H = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.o: D = None
        self.q: F = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

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