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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: E = None
        self.txt = txt

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

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