class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.p: C = None
        self.z: F = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: A = None
        self.s: B = None
        self.q: H = None
        self.p: I = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.o: I = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.q: D = None
        self.u: G = None
        self.y: A = None
        self.z: H = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: A = None
        self.s: B = None
        self.q: H = None
        self.p: I = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.o: I = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.q: D = None
        self.u: G = None
        self.y: A = None
        self.z: H = None
        self.v: B = None
        self.txt = txt

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

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