class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: G = None
        self.s: B = None
        self.v: G = None
        self.z: H = None
        self.p: B = None
        self.w: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: D = None
        self.y: C = None
        self.u: H = None
        self.s: C = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.y: I = None
        self.p: D = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

c = A("c")
j = B("j")
a = C("a")
n = D("n")
l = E("l")
m = F("m")
e = G("e")
b = H("b")
g = I("g")

c.x = l
c.s = g
j.x = a
a.z = n
n.w = b
n.r = c
n.y = l
n.o = l
n.z = m
n.x = m
n.s = j
l.r = a
l.q = e
l.v = e
l.w = e
l.s = j
l.p = j
l.z = b
l.o = b
m.x = c
m.p = n
m.y = a
m.s = a
m.u = b
m.v = b
e.x = c
e.z = j
e.y = g
e.p = n
e.t = a
e.u = b
b.z = j
b.p = c
b.s = l
b.q = m
g.o = a
assert g.o.z.w.q.s.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: G = None
        self.s: B = None
        self.v: G = None
        self.z: H = None
        self.p: B = None
        self.w: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: D = None
        self.y: C = None
        self.u: H = None
        self.s: C = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.y: I = None
        self.p: D = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

c = A("c")
j = B("j")
a = C("a")
n = D("n")
l = E("l")
m = F("m")
e = G("e")
b = H("b")
g = I("g")

c.x = l
c.s = g
j.x = a
a.z = n
n.w = b
n.r = c
n.y = l
n.o = l
n.z = m
n.x = m
n.s = j
l.r = a
l.q = e
l.v = e
l.w = e
l.s = j
l.p = j
l.z = b
l.o = b
m.x = c
m.p = n
m.y = a
m.s = a
m.u = b
m.v = b
e.x = c
e.z = j
e.y = g
e.p = n
e.t = a
e.u = b
b.z = j
b.p = c
b.s = l
b.q = m
g.o = a
assert g.o.z.w.q.s.z.r.txt == "c"