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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: I = None
        self.y: F = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: B = None
        self.t: E = None
        self.o: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.t: A = None
        self.y: A = None
        self.o: C = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: I = None
        self.y: F = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: B = None
        self.t: E = None
        self.o: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.t: A = None
        self.y: A = None
        self.o: C = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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