class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.z: G = None
        self.o: D = None
        self.p: C = None
        self.s: B = None
        self.u: A = None
        self.q: E = None
        self.t: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: J = None
        self.t: A = None
        self.v: C = None
        self.r: B = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.z: G = None
        self.o: D = None
        self.p: C = None
        self.s: B = None
        self.u: A = None
        self.q: E = None
        self.t: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: J = None
        self.t: A = None
        self.v: C = None
        self.r: B = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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