class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: I = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.r: A = None
        self.x: C = None
        self.u: G = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.t: I = None
        self.p: I = None
        self.v: A = None
        self.r: B = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

d.y = l
d.x = i
f.q = d
f.s = d
f.o = d
f.t = m
f.z = k
f.y = a
f.w = a
f.p = l
f.v = b
i.u = a
i.s = a
i.t = b
i.y = f
m.o = d
m.q = d
m.r = d
m.x = i
m.v = i
m.u = e
k.z = d
k.o = d
k.v = d
k.x = d
k.t = b
k.p = b
k.r = f
k.q = l
l.t = k
l.q = a
j.x = f
a.z = i
b.u = l
b.s = l
b.z = k
b.x = k
b.q = j
b.o = i
b.w = a
e.x = f
assert j.x.z.x.x.s.z.u.z.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: I = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.r: A = None
        self.x: C = None
        self.u: G = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.t: I = None
        self.p: I = None
        self.v: A = None
        self.r: B = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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