class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: B = None
        self.q: F = None
        self.o: E = None
        self.t: B = None
        self.p: H = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: H = None
        self.u: F = None
        self.q: E = None
        self.t: H = None
        self.s: E = None
        self.r: H = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.r: B = None
        self.x: C = None
        self.o: E = None
        self.z: H = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.x: C = None
        self.y: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: H = None
        self.u: F = None
        self.q: E = None
        self.t: H = None
        self.s: E = None
        self.r: H = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.r: B = None
        self.x: C = None
        self.o: E = None
        self.z: H = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.x: C = None
        self.y: H = None
        self.txt = txt

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

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

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