class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: I = None
        self.t: B = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: H = None
        self.w: F = None
        self.z: I = None
        self.q: I = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: C = None
        self.s: A = None
        self.x: H = None
        self.p: F = None
        self.q: C = None
        self.o: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.s: F = None
        self.o: G = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: H = None
        self.w: F = None
        self.z: I = None
        self.q: I = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: C = None
        self.s: A = None
        self.x: H = None
        self.p: F = None
        self.q: C = None
        self.o: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.s: F = None
        self.o: G = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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