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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.q: I = None
        self.z: D = None
        self.o: A = None
        self.s: E = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: F = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.v: F = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.q: I = None
        self.z: D = None
        self.o: A = None
        self.s: E = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: F = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.v: F = None
        self.s: C = None
        self.txt = txt

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

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