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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: H = None
        self.v: C = None
        self.s: D = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.r: H = None
        self.q: F = None
        self.s: D = None
        self.o: D = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: H = None
        self.v: C = None
        self.s: D = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.r: H = None
        self.q: F = None
        self.s: D = None
        self.o: D = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: F = None
        self.txt = txt

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

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