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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.x: E = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.r: D = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.x: E = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.r: D = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

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