class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: I = None
        self.s: D = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: A = None
        self.z: F = None
        self.r: E = None
        self.p: E = None
        self.v: H = None
        self.y: A = None
        self.t: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.p: H = None
        self.r: H = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: A = None
        self.z: F = None
        self.r: E = None
        self.p: E = None
        self.v: H = None
        self.y: A = None
        self.t: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.p: H = None
        self.r: H = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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