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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: J = None
        self.x: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.w: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.u: J = None
        self.r: J = None
        self.o: I = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: C = None
        self.s: H = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: J = None
        self.x: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.w: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.u: J = None
        self.r: J = None
        self.o: I = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: C = None
        self.s: H = None
        self.w: F = None
        self.txt = txt

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

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