class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.x: C = None
        self.v: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.x: F = None
        self.z: B = None
        self.o: E = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.x: F = None
        self.z: B = None
        self.o: E = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

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

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

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