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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.w: B = None
        self.y: F = None
        self.r: E = None
        self.s: F = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: A = None
        self.r: H = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.w: B = None
        self.y: F = None
        self.r: E = None
        self.s: F = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: A = None
        self.r: H = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: G = None
        self.txt = txt

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

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

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

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