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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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