class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: D = None
        self.w: E = None
        self.t: D = None
        self.o: I = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: A = None
        self.t: C = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.x: B = None
        self.v: H = None
        self.r: F = None
        self.y: F = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: F = None
        self.r: G = None
        self.s: D = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: A = None
        self.t: C = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.x: B = None
        self.v: H = None
        self.r: F = None
        self.y: F = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: F = None
        self.r: G = None
        self.s: D = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: F = None
        self.txt = txt

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

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