class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.v: D = None
        self.s: H = None
        self.t: C = None
        self.z: H = None
        self.u: B = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: F = None
        self.z: E = None
        self.r: B = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.w: C = None
        self.r: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: F = None
        self.z: E = None
        self.r: B = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.w: C = None
        self.r: H = None
        self.txt = txt

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

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