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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: D = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: C = None
        self.z: C = None
        self.u: B = None
        self.w: H = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: D = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: C = None
        self.z: C = None
        self.u: B = None
        self.w: H = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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