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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: D = None
        self.o: H = None
        self.p: E = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: D = None
        self.o: H = None
        self.p: E = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

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

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

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