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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: H = None
        self.u: G = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: B = None
        self.u: H = None
        self.r: E = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.t: C = None
        self.p: H = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: H = None
        self.u: G = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: B = None
        self.u: H = None
        self.r: E = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.t: C = None
        self.p: H = None
        self.q: G = None
        self.txt = txt

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

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