class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: A = None
        self.z: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: A = None
        self.z: F = None
        self.u: D = None
        self.txt = txt

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

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

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