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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: I = None
        self.q: E = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: H = None
        self.o: G = None
        self.z: I = None
        self.w: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.q: F = None
        self.r: F = None
        self.u: F = None
        self.p: E = None
        self.w: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
i = D("i")
j = E("j")
m = F("m")
k = G("k")
d = H("d")
l = I("l")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: I = None
        self.q: E = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: H = None
        self.o: G = None
        self.z: I = None
        self.w: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.q: F = None
        self.r: F = None
        self.u: F = None
        self.p: E = None
        self.w: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
i = D("i")
j = E("j")
m = F("m")
k = G("k")
d = H("d")
l = I("l")
h = F("h")

a.v = g
a.p = j
n.w = k
n.r = k
n.o = l
n.q = j
g.r = n
g.u = k
g.y = d
g.v = d
i.t = a
i.u = d
i.o = k
i.z = l
i.w = j
j.t = n
j.z = n
j.x = a
j.u = a
j.p = a
j.w = h
j.y = g
j.v = l
m.y = g
m.z = d
m.q = n
k.v = j
k.y = d
k.z = a
k.p = m
k.q = l
k.o = l
k.x = l
k.u = i
k.t = n
d.y = a
d.v = i
d.q = h
d.r = h
d.u = m
d.p = j
d.x = j
d.w = l
l.r = j
h.y = g
h.z = d
h.q = n
assert g.u.p.z.w.r.txt == "j"