class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: C = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: F = None
        self.q: F = None
        self.r: G = None
        self.x: D = None
        self.z: I = None
        self.t: H = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: F = None
        self.p: G = None
        self.y: G = None
        self.o: I = None
        self.z: E = None
        self.s: F = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: C = None
        self.r: A = None
        self.z: J = None
        self.s: H = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: F = None
        self.q: F = None
        self.r: G = None
        self.x: D = None
        self.z: I = None
        self.t: H = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: F = None
        self.p: G = None
        self.y: G = None
        self.o: I = None
        self.z: E = None
        self.s: F = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: C = None
        self.r: A = None
        self.z: J = None
        self.s: H = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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