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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.v: H = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: A = None
        self.s: B = None
        self.v: G = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.t: F = None
        self.z: A = None
        self.r: G = None
        self.y: F = None
        self.txt = txt

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

f.y = h
f.s = l
f.u = l
f.x = g
f.q = a
g.z = n
n.y = l
n.q = e
l.z = f
l.t = g
l.v = c
l.u = a
e.s = n
h.x = c
h.u = f
h.t = f
h.s = g
h.v = a
k.o = a
k.r = c
k.v = h
b.x = g
b.w = e
b.t = h
b.y = h
b.z = f
b.r = a
c.x = g
c.w = e
c.t = h
c.y = h
c.z = f
c.r = a
a.o = k
a.r = b
a.v = h
assert a.o.r.t.v.v.v.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.u: D = None
        self.x: B = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.v: H = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: A = None
        self.s: B = None
        self.v: G = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.t: F = None
        self.z: A = None
        self.r: G = None
        self.y: F = None
        self.txt = txt

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

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