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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.q: A = None
        self.r: A = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.q: A = None
        self.r: A = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: G = None
        self.z: C = None
        self.txt = txt

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

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