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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.u: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.p: G = None
        self.z: F = None
        self.w: H = None
        self.r: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: F = None
        self.z: C = None
        self.s: D = None
        self.p: H = None
        self.txt = txt

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

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

a.y = m
k.t = j
k.v = n
k.r = c
k.o = a
k.z = e
e.r = c
b.s = f
b.y = f
b.u = c
b.q = k
c.q = j
c.z = j
c.r = j
c.v = a
c.p = f
c.x = f
c.w = n
j.x = m
f.t = c
f.v = j
f.z = e
f.s = b
f.p = n
n.q = e
n.u = e
n.w = j
n.r = k
n.s = a
n.x = a
m.t = j
m.v = n
m.r = c
m.o = a
m.z = e
assert j.x.v.w.x.v.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.u: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.p: G = None
        self.z: F = None
        self.w: H = None
        self.r: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: F = None
        self.z: C = None
        self.s: D = None
        self.p: H = None
        self.txt = txt

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

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

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