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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.t: G = None
        self.u: B = None
        self.r: B = None
        self.y: G = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.t: G = None
        self.u: B = None
        self.r: B = None
        self.y: G = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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