class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: A = None
        self.r: D = None
        self.p: H = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: E = None
        self.u: E = None
        self.o: E = None
        self.v: A = None
        self.r: E = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: A = None
        self.r: D = None
        self.p: H = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: E = None
        self.u: E = None
        self.o: E = None
        self.v: A = None
        self.r: E = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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