class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: D = None
        self.s: C = None
        self.q: D = None
        self.w: H = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.s: F = None
        self.x: D = None
        self.p: C = None
        self.w: I = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.z: B = None
        self.t: I = None
        self.s: H = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: H = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: C = None
        self.y: B = None
        self.w: A = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: B = None
        self.s: I = None
        self.p: E = None
        self.z: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: G = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.s: F = None
        self.x: D = None
        self.p: C = None
        self.w: I = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.z: B = None
        self.t: I = None
        self.s: H = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: H = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: C = None
        self.y: B = None
        self.w: A = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: B = None
        self.s: I = None
        self.p: E = None
        self.z: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: G = None
        self.x: C = None
        self.txt = txt

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

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