class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.p: E = None
        self.w: B = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: D = None
        self.s: D = None
        self.q: B = None
        self.p: A = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.p: E = None
        self.w: B = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: D = None
        self.s: D = None
        self.q: B = None
        self.p: A = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

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

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