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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.v: G = None
        self.r: C = None
        self.u: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: J = None
        self.t: I = None
        self.q: I = None
        self.s: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: G = None
        self.o: G = None
        self.t: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.v: G = None
        self.r: C = None
        self.u: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: J = None
        self.t: I = None
        self.q: I = None
        self.s: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: G = None
        self.o: G = None
        self.t: I = None
        self.txt = txt

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

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