class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.t: I = None
        self.y: D = None
        self.q: I = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: C = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.w: H = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.z: A = None
        self.s: B = None
        self.u: B = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: C = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.w: H = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.z: A = None
        self.s: B = None
        self.u: B = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

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

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

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