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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: H = None
        self.x: A = None
        self.v: D = None
        self.s: I = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.q: B = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: D = None
        self.o: C = None
        self.w: C = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: H = None
        self.x: A = None
        self.v: D = None
        self.s: I = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.q: B = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: D = None
        self.o: C = None
        self.w: C = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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