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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: D = None
        self.w: G = None
        self.o: H = None
        self.y: F = None
        self.r: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: G = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: A = None
        self.q: A = None
        self.x: D = None
        self.u: B = None
        self.s: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: A = None
        self.s: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: D = None
        self.w: G = None
        self.o: H = None
        self.y: F = None
        self.r: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: G = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: A = None
        self.q: A = None
        self.x: D = None
        self.u: B = None
        self.s: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: A = None
        self.s: E = None
        self.r: F = None
        self.txt = txt

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

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

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