class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: J = None
        self.z: A = None
        self.x: B = None
        self.o: I = None
        self.p: B = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: G = None
        self.y: F = None
        self.v: A = None
        self.t: H = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: G = None
        self.z: E = None
        self.r: J = None
        self.y: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: J = None
        self.z: A = None
        self.x: B = None
        self.o: I = None
        self.p: B = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: G = None
        self.y: F = None
        self.v: A = None
        self.t: H = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: G = None
        self.z: E = None
        self.r: J = None
        self.y: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

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