class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: H = None
        self.u: A = None
        self.t: A = None
        self.w: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: D = None
        self.y: G = None
        self.v: B = None
        self.q: I = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: E = None
        self.s: A = None
        self.y: C = None
        self.q: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: D = None
        self.t: C = None
        self.o: A = 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.u: G = None
        self.x: E = None
        self.w: A = None
        self.o: D = None
        self.v: F = None
        self.z: D = None
        self.t: E = None
        self.q: G = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: H = None
        self.u: A = None
        self.t: A = None
        self.w: C = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: D = None
        self.y: G = None
        self.v: B = None
        self.q: I = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: E = None
        self.s: A = None
        self.y: C = None
        self.q: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: D = None
        self.t: C = None
        self.o: A = 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.u: G = None
        self.x: E = None
        self.w: A = None
        self.o: D = None
        self.v: F = None
        self.z: D = None
        self.t: E = None
        self.q: G = None
        self.p: E = None
        self.txt = txt

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

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

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

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