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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.x: B = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.z: C = None
        self.s: E = None
        self.o: F = None
        self.p: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.x: B = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.z: C = None
        self.s: E = None
        self.o: F = None
        self.p: B = None
        self.y: F = None
        self.txt = txt

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

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