class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: D = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: D = None
        self.t: D = None
        self.w: F = None
        self.p: H = None
        self.r: J = None
        self.x: B = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: D = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: D = None
        self.t: D = None
        self.w: F = None
        self.p: H = None
        self.r: J = None
        self.x: B = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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