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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: D = None
        self.s: E = None
        self.t: C = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: D = None
        self.s: E = None
        self.t: C = None
        self.p: H = None
        self.txt = txt

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

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

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

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