class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: G = None
        self.y: E = None
        self.o: H = None
        self.z: E = None
        self.s: I = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: D = None
        self.u: A = None
        self.o: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: G = None
        self.y: E = None
        self.o: H = None
        self.z: E = None
        self.s: I = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: D = None
        self.u: A = None
        self.o: E = None
        self.txt = txt

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

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

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