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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.v: G = None
        self.p: D = None
        self.y: B = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.s: C = None
        self.y: C = None
        self.q: B = None
        self.o: D = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

a = A("a")
f = B("f")
m = C("m")
k = D("k")
l = E("l")
h = F("h")
c = G("c")
e = H("e")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.v: G = None
        self.p: D = None
        self.y: B = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.s: C = None
        self.y: C = None
        self.q: B = None
        self.o: D = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

a = A("a")
f = B("f")
m = C("m")
k = D("k")
l = E("l")
h = F("h")
c = G("c")
e = H("e")

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