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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: G = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.s: J = None
        self.v: G = None
        self.x: I = None
        self.q: B = None
        self.w: I = None
        self.p: G = None
        self.u: J = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: G = None
        self.q: H = None
        self.r: B = None
        self.v: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: C = None
        self.y: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.o: H = None
        self.x: D = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

h = A("h")
f = B("f")
a = C("a")
j = D("j")
g = E("g")
c = F("c")
m = G("m")
k = H("k")
b = I("b")
d = J("d")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: G = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.s: J = None
        self.v: G = None
        self.x: I = None
        self.q: B = None
        self.w: I = None
        self.p: G = None
        self.u: J = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: G = None
        self.q: H = None
        self.r: B = None
        self.v: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: C = None
        self.y: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.o: H = None
        self.x: D = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

h = A("h")
f = B("f")
a = C("a")
j = D("j")
g = E("g")
c = F("c")
m = G("m")
k = H("k")
b = I("b")
d = J("d")

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