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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: D = None
        self.o: E = None
        self.y: D = None
        self.x: I = None
        self.s: C = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: D = None
        self.o: E = None
        self.y: D = None
        self.x: I = None
        self.s: C = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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