class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: C = None
        self.p: G = None
        self.w: G = None
        self.u: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: E = None
        self.s: I = None
        self.t: A = None
        self.z: C = None
        self.o: H = None
        self.y: H = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: C = None
        self.p: G = None
        self.w: G = None
        self.u: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: E = None
        self.s: I = None
        self.t: A = None
        self.z: C = None
        self.o: H = None
        self.y: H = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: G = None
        self.txt = txt

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

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