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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.x: A = None
        self.v: D = None
        self.s: I = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: D = None
        self.r: I = None
        self.s: D = None
        self.w: J = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.x: I = None
        self.u: F = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: I = None
        self.o: C = None
        self.txt = txt

c = A("c")
g = B("g")
f = C("f")
h = D("h")
i = E("i")
j = F("j")
k = G("k")
e = H("e")
a = I("a")
n = J("n")

c.z = h
c.u = f
c.q = n
g.z = h
g.v = h
g.u = k
g.x = c
g.s = a
g.o = n
f.t = h
f.r = g
f.y = j
f.w = i
h.o = k
i.x = f
j.s = e
j.r = f
j.p = h
j.x = k
k.q = i
k.u = h
k.s = h
k.r = a
k.w = n
k.t = g
e.q = g
e.p = g
e.v = f
e.y = f
e.x = a
e.u = j
a.v = k
a.u = i
a.r = n
n.t = e
n.q = a
n.o = f
assert f.w.x.r.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.q: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.x: A = None
        self.v: D = None
        self.s: I = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: D = None
        self.r: I = None
        self.s: D = None
        self.w: J = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.x: I = None
        self.u: F = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: I = None
        self.o: C = None
        self.txt = txt

c = A("c")
g = B("g")
f = C("f")
h = D("h")
i = E("i")
j = F("j")
k = G("k")
e = H("e")
a = I("a")
n = J("n")

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