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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: G = None
        self.o: H = None
        self.t: G = None
        self.s: A = None
        self.x: H = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.t: D = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: C = None
        self.w: D = None
        self.u: I = None
        self.p: C = None
        self.s: C = None
        self.r: G = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.s: C = None
        self.v: J = None
        self.z: G = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: A = None
        self.v: J = None
        self.z: E = None
        self.s: D = None
        self.x: J = None
        self.y: F = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: G = None
        self.o: H = None
        self.t: G = None
        self.s: A = None
        self.x: H = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.t: D = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: C = None
        self.w: D = None
        self.u: I = None
        self.p: C = None
        self.s: C = None
        self.r: G = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.s: C = None
        self.v: J = None
        self.z: G = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: A = None
        self.v: J = None
        self.z: E = None
        self.s: D = None
        self.x: J = None
        self.y: F = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

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

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

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