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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: E = None
        self.t: C = None
        self.q: G = None
        self.z: D = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.o: C = None
        self.x: H = None
        self.q: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: H = None
        self.w: D = None
        self.u: H = None
        self.s: I = None
        self.y: B = None
        self.p: H = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.p: B = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: H = None
        self.z: H = None
        self.u: B = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: E = None
        self.t: C = None
        self.q: G = None
        self.z: D = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.o: C = None
        self.x: H = None
        self.q: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: H = None
        self.w: D = None
        self.u: H = None
        self.s: I = None
        self.y: B = None
        self.p: H = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.p: B = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: H = None
        self.z: H = None
        self.u: B = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

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