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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.o: B = None
        self.v: H = None
        self.s: H = None
        self.x: F = None
        self.q: F = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: C = None
        self.p: E = None
        self.w: H = None
        self.y: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: D = None
        self.p: C = None
        self.x: D = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.o: B = None
        self.v: H = None
        self.s: H = None
        self.x: F = None
        self.q: F = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: C = None
        self.p: E = None
        self.w: H = None
        self.y: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: D = None
        self.p: C = None
        self.x: D = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

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