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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.x: F = None
        self.v: G = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: E = None
        self.w: C = None
        self.q: H = None
        self.x: F = None
        self.y: J = None
        self.v: I = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: D = None
        self.r: C = None
        self.q: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.p: C = None
        self.u: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: F = None
        self.p: B = None
        self.s: F = None
        self.x: B = None
        self.y: I = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.x: F = None
        self.v: G = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: E = None
        self.w: C = None
        self.q: H = None
        self.x: F = None
        self.y: J = None
        self.v: I = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: D = None
        self.r: C = None
        self.q: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: A = None
        self.p: C = None
        self.u: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: F = None
        self.p: B = None
        self.s: F = None
        self.x: B = None
        self.y: I = None
        self.w: B = None
        self.txt = txt

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

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