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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: C = None
        self.o: J = None
        self.z: E = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.p: E = None
        self.q: A = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: G = None
        self.z: H = None
        self.o: B = None
        self.y: J = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: J = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: D = None
        self.z: G = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: I = None
        self.q: D = None
        self.x: A = None
        self.r: G = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: C = None
        self.o: J = None
        self.z: E = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.p: E = None
        self.q: A = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: G = None
        self.z: H = None
        self.o: B = None
        self.y: J = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: J = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: D = None
        self.z: G = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: I = None
        self.q: D = None
        self.x: A = None
        self.r: G = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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