class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: D = None
        self.o: E = None
        self.r: F = None
        self.q: H = None
        self.u: F = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: I = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: D = None
        self.o: E = None
        self.r: F = None
        self.q: H = None
        self.u: F = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: I = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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