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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.r: H = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: A = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.r: A = None
        self.t: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.r: H = None
        self.p: C = None
        self.s: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: A = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.r: A = None
        self.t: H = None
        self.txt = txt

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

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