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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: E = None
        self.o: I = None
        self.y: D = None
        self.t: C = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: E = None
        self.o: I = None
        self.y: D = None
        self.t: C = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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