class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: C = None
        self.v: H = None
        self.x: I = None
        self.u: F = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: I = None
        self.t: C = None
        self.p: F = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: I = None
        self.w: G = None
        self.x: G = None
        self.s: D = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: C = None
        self.s: C = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: B = None
        self.z: F = None
        self.o: E = None
        self.v: G = None
        self.q: I = None
        self.y: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: I = None
        self.t: C = None
        self.p: F = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: I = None
        self.w: G = None
        self.x: G = None
        self.s: D = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: C = None
        self.s: C = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: B = None
        self.z: F = None
        self.o: E = None
        self.v: G = None
        self.q: I = None
        self.y: A = None
        self.txt = txt

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

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

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