class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: B = None
        self.o: I = None
        self.x: C = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.u: G = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: A = None
        self.t: A = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: C = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.u: G = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: A = None
        self.t: A = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: C = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

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

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

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

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