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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: C = None
        self.p: B = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.u: F = None
        self.q: F = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: C = None
        self.p: B = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.u: F = None
        self.q: F = None
        self.z: E = None
        self.txt = txt

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

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