class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: C = None
        self.p: E = None
        self.z: E = None
        self.u: F = None
        self.y: E = None
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: B = None
        self.z: I = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: I = None
        self.p: H = None
        self.o: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: B = None
        self.z: I = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: I = None
        self.p: H = None
        self.o: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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