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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.v: I = None
        self.o: E = None
        self.s: G = None
        self.q: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: G = None
        self.w: C = None
        self.p: B = None
        self.u: A = None
        self.r: G = None
        self.z: I = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.v: I = None
        self.o: E = None
        self.s: G = None
        self.q: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: G = None
        self.w: C = None
        self.p: B = None
        self.u: A = None
        self.r: G = None
        self.z: I = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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