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

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: H = None
        self.r: D = None
        self.t: H = None
        self.w: E = None
        self.u: D = None
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.w: A = None
        self.z: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: H = None
        self.r: D = None
        self.t: H = None
        self.w: E = None
        self.u: D = None
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.w: A = None
        self.z: I = None
        self.txt = txt

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

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

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