class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: E = None
        self.v: D = None
        self.y: B = None
        self.u: G = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: E = None
        self.v: D = None
        self.y: B = None
        self.u: G = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

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

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

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