class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: G = None
        self.z: G = None
        self.q: E = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: I = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: G = None
        self.z: G = None
        self.q: E = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: I = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.v: B = None
        self.txt = txt

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

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